convert a Julian date value into a string
string get_date_str( double dDateTime, WORD wFormat = LDF_SHORT_AND_HHMMSS_SEPARCOLON, LPCSTR lpcszCustom = NULL )
A string containing the converted date/time.
EX1
void get_date_str_ex1() { SYSTEMTIME st; GetSystemTime(&st); // gets current time, // need to convert to local time FILETIME ft, ftLocal; SystemTimeToFileTime(&st, &ft); FileTimeToLocalFileTime(&ft, &ftLocal); FileTimeToSystemTime(&ftLocal, &st); double dDate; SystemTimeToJulianDate(&dDate, &st); out_str(get_date_str(dDate, LDF_SHORT_AND_HHMM_SEPARCOLON)); }
EX2
void get_date_str_ex2() { SYSTEMTIME st; GetSystemTime(&st); // gets current time, // need to convert to local time FILETIME ft, ftLocal; SystemTimeToFileTime(&st, &ft); FileTimeToLocalFileTime(&ft, &ftLocal); FileTimeToSystemTime(&ftLocal, &st); double dDate; SystemTimeToJulianDate(&dDate, &st); out_str(get_date_str(dDate, LDF_OBJ_CUSTOM, "yyyy/MM/dd")); }
origin.h