Help Center

COleDateTime.Constructorsconstructor

Create new **COleDateTime** objects initialized to the specified value.

DateTimeconstructorCOleDateTime.incdoc-orphan
No implementation located. This member is documented, but the source scan found no matching declaration. It is likely declared in a header this scan does not resolve, or provided by a macro.

Syntax

CONSTRUCTOR COleDateTime
CONSTRUCTOR COleDateTime (BYREF dateSrc AS COleDateTime)
CONSTRUCTOR COleDateTime (BYREF varSrc AS VARIANT)
CONSTRUCTOR COleDateTime (BYVAL dtSrc AS DATE_)
CONSTRUCTOR COleDateTime (BYVAL timeSrc AS LONGLONG)
CONSTRUCTOR COleDateTime (BYREF systimeSrc AS SYSTEMTIME)
CONSTRUCTOR COleDateTime (BYREF filetimeSrc AS FILETIME)
CONSTRUCTOR COleDateTime (BYVAL wDosDate AS DWORD, BYVAL wDosTime AS WORD)
CONSTRUCTOR COleDateTime (BYREF dbts AS DBTIMESTAMP)
CONSTRUCTOR COleDateTime (BYREF ud AS UDATE)
CONSTRUCTOR COleDateTime (BYVAL nYear AS WORD, BYVAL nMonth AS WORD, BYVAL nDay AS WORD, BYVAL nHour AS WORD, BYVAL nMin AS WORD, BYVAL nSec AS WORD)
CONSTRUCTOR COleDateTime (BYREF wsz AS WSTRING, BYVAL dwFlags AS DWORD = 0, BYVAL lcid AS LCID = LANG_USER_DEFAULT)

Parameters

NameDescription
dateSrcAn existing COleDateTime object to be copied into the new COleDateTime object.
varSrcAn existing VARIANT data structure to be converted to a date/time value (VT_DATE) and copied into the new COleDateTime object.
dtSrcA date/time ( DATE) value to be copied into the new COleDateTime object.
timeSrcA LongInt value to be converted to a date/time value and copied into the new COleDateTime object.
systimeSrcA SYSTEMTIME structure to be converted to a date/time value and copied into the new COleDateTime object.
filetimeSrcA FILETIME structure to be converted to a date/time value and copied into the new COleDateTime object. Note that FILETIME uses Universal Coordinated Time (UTC), so if you pass a local time in the structure, your results will be incorrect. See File Times in the Windows SDK for more information.
nYear / nMonth / nDay / nHour / nMin / nSecIndicate the date and time values to be copied into the new COleDateTime object.
wDosDate / wDosTimeMS-DOS date and time values to be converted to a date/time value and copied into the new COleDateTime object.
dbtsA reference to a DBTimeStamp structure containing the current local time.
udThe UDATE value is converted and copied into this COleDateTime object. If the conversion is successful, the status of this object is set to valid; if unsuccessful, it is set to invalid. A UDATE structure represents an "unpacked" date. See the function VarDateFromUdate for more details.
wszA null-terminated unicode string which is to be parsed. This parameter can take a variety of formats. For example, the following strings contain acceptable date/time formats:
"25 January 1996"
"8:30:00"
"20:30:00"
"January 25, 1996 8:30:00"
"8:30:00 Jan. 25, 1996"
"1/25/1996 8:30:00" // always specify the full year, even in a 'short date' format.
Note that the locale ID will also affect whether the string format is acceptable for conversion to a date/time value. In the case of VAR_DATEVALUEONLY, the time value is set to time 0, or midnight. In the case of VAR_TIMEVALUEONLY, the date value is set to date 0, meaning 30 December 1899.
dwFlagsIndicates flags for locale settings and parsing.
LOCALE_NOUSEROVERRIDE Use the system default locale settings, rather than custom user settings.
VAR_TIMEVALUEONLY Ignore the date portion during parsing.
VAR_DATEVALUEONLY Ignore the time portion during parsing.
lcidIndicates locale ID to use for the conversion. Default value: LANG_USER_DEFAULT.

Description

Create new COleDateTime objects initialized to the specified value.

Remarks

The status of the new COleDateTime object is set to valid.

Reference

  • Include file COleDateTime.inc
  • Documented in DateTime/COleDateTime Class.md
  • Topic: COleDateTime Class