GXParseDateTime
BOOL
XParseDateTime(TIMESTAMP_STRUCT* pts, LPCTSTR szValue, GXDateFormat DateFormat = gxDEFAULT);
BOOL
XParseDateTime(struct tm* ptm, LPCTSTR szValue, GXDateFormat DateFormat = gxDEFAULT);
pts
Points to a TIMESTAMP_STRUCT where the method will store the date information.
ptm
Points to a tm structure where the method will store the date information.
szValue
Pointer to a zero-terminated string which holds the formatted date or time.
DateFormat
-
Specifies the date format:
- gxDEFAULT - Date format is read out from WIN.INI or registry.
- gxDDMMYY - Date format is “DDMMYY”.
- gxMMDDYY - Date format is “MMDDYY”.
gxYYMMDD - Date format is “YYMMDD”.
Return Value
Specifies whether the function could successfully determine the date and time information from the string. It is TRUE if szValue contained a correct date or time format. It is FALSE if the date or time value is invalid.
Remarks
Parses a given string with locale date format and reads out the date and time.
Both TIMESTAMP_STRUCT and CTime date representations are supported. The advantage of TIMESTAMP_STRUCT is that you can specify dates earlier than 1970 and later than 2037, which is a known limitation of the CTime class.
Control-Factory Specific ->
This method has been implemented using the abstraction mechanism as discussed in the chapter "Reducing the size of your application" in the user's guide. A call to the GXImplementOleDateTime or GXImplementNoOleDateTime method from within the control factory class' InitializeGridComponents method will make the concrete implementation of this method available to your application.
If no concrete implementation is available this method returns FALSE. A warning will be displayed in the debug window.
END Control-Factory Specific
See Also
GXFormatTimeStamp GXUpdateDateTimeSettings