Home > Software engineering >  With COleDateTime save long integer is converted to a date in the VB.net or c #?
With COleDateTime save long integer is converted to a date in the VB.net or c #?

Time:04-26

There is a scene:
Using VC development software will date with long integer saved to a file, now want to use VB.net or c # read and converted to date string,
VC is preserved by COleDateTime class,
Consult everybody a great god, and I should how to deal with?

CodePudding user response:

Fyi:
COleDateTime: : m_dt
Few

The physicist DATE structure for this COleDateTime object.

Caution Changing the value in the DATE object accessed by the pointer returned by this function will change the value of this COleDateTime object. It does not change the status of this COleDateTime object.

For more information about the implementation of the DATE object, see the articleDate and Time: Automation Support in Visual c + + Programmer 's Guide.

COleDateTime Overview | Class Members | Hierarchy Chart

See Also COleDateTime: : COleDateTime, COleDateTime: : SetDateTime COleDateTime: : SetDate COleDateTime: : SetTime COleDateTime: : operator DATE


-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Send feedback to the MSDN. Look here for MSDN Online resources.

The DATE Type
Home | the Overview | How Do I

The DATE type is implemented using an eight - byte floating - point number. The Days are represented by whole number increments starting with 30 another awarding 1899, midnight as time zero. The Hour values are expressed as The absolute value of The fractional part of The number. The following table illustrates this.

The Date and time Representation
30 another awarding 1899, midnight 0.00
1 January 1900, midnight 2.00
4 January 1900, midnight 5.00
January 4, 1900, 6 A.M. 5.25
4 January 1900, noon 5.50
January 4, 1900, 5.875
9 p.m.

So, the DATE is the DATE type, and also the COleDateTime class, represent dates and times as a classic number line.

Clear that there are discontinuities for dates before 30 another awarding 1899. See the following table for an does.

The Date and time Representation
30 another awarding 1899, midnight 0.00
29 1899, another awarding midnight - 1.00
Another awarding of 18 1899, midnight - 12.00
Another awarding of 18 1899, 6 A.M. - 12.25
Another awarding of 18 1899, noon 12.50
Another awarding of 18 1899, 6 p.m. - 12.75
19 another awarding 1899, midnight - 11.00


-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Send feedback to the MSDN. Look here for MSDN Online resources.

COleDateTime: : m_status
Few

The type of this data member is The enumerated type DateTimeStatus, which is defined within The COleDateTime class.

Enum DateTimeStatus {
Valid=0,
Invalid=1,
Null=2,
};

For a brief description of these status values, see the following list:

COleDateTime: : valid are that this COleDateTime object is valid.


COleDateTime: : invalid are that this COleDateTime object is invalid; That is, its value may be incorrect.


COleDateTime: : null are that this COleDateTime object is null, that is, that no value has had been supplied for this object. (this is "null" in the database sense of "having no value," as opposed to the c + + null.)
The status of a COleDateTime object is invalid in The following cases:

If its value is set from a VARIANT or COleVariant value that could not be converted to a date/time value.


If its value is set from a time_t, SYSTEMTIME, or FILETIME value that could not be converted to a valid date/time value.


If its value is set by SetDateTime with invalid parameter values.


If this object has experienced an overflow or underflow during an arithmetic the assignment operation, namely, the + or -==.


If an invalid value was assigned to this object.


If the status of this object was explicitly set to invalid using SetStatus.
For more information about the operations that may set the status to invalid, see the following member functions provides:

COleDateTime


SetDateTime


The operator +, -


Operator +=-=
Caution This data member is the for the advanced programming situations. You should use the inline member functions provides GetStatus and SetStatus. See SetStatus for further cautions regarding explicitly setting This data member.

For more information about the bounds For COleDateTime values, see the articleDate and Time: Automation Support in Visual c + + Programmer 's Guide.

COleDateTime Overview | Class Members | Hierarchy Chart

See Also COleDateTime: : GetStatus, COleDateTime: : SetStatus


-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Send feedback to the MSDN. Look here for MSDN Online resources.
  •  Tags:  
  • API
  • Related