2.1.8.29 str_to_date_custom


Description

Convert a text string that represents date/time into a Julian date value

Syntax

BOOL str_to_date_custom( LPCSTR lpcszDateStr, LPCSTR lpcszFormatStr, double * pDate, DWORD dwOptions = 0 )

Parameters

lpcszDateStr
[input] A date/time string
lpcszFormatStr
[input] Pointer to a format picture string that is used to form the date string
pDate
[output] Pointer will point to Julian date if success else NANUM
dwOptions
[input] Optional format options

Return

True if success, else false

Examples

EX1

void str_to_date_custom_ex1()
{
    string strDate = "2003-03-21";
    string strFormt = "yyyy'-'MM'-'dd";
    double db;
    
    if(str_to_date_custom(strDate, strFormt,&db))
    {
        printf("You have entered %s\n", get_date_str(db));
    }
}

Remark

See Also

str_to_date

Header to Include

origin.h

Reference