2.1.8.22 JulianDateToSystemTime


Description

convert a double in Julian date format to a system time struct

Syntax

BOOL JulianDateToSystemTime(const double* pdDate, SYSTEMTIME *pSysTime, double *pdMillSec = NULL, int nRound = -1)

Parameters

pdDate
[input] pointer to double holding date-time value to be converted
pSysTime
[output] pointer to a struct to receive conversion result
pdMillSec
[output] pointer to receive the double type value of millisecond. wMilliseconds in SYSTEMTIME is a WORD type value.
nRound
[input] used to set the dicimal places for pdMillSec. -1 means no rounding.

Return

True for success, false if failed to convert like if input double is not in valid range for Julian date

Examples

EX1

void JulianDateToSystemTime_Ex1()
{
    SYSTEMTIME st , stCheck ;
    char lpcstrTime[100];
  
    GetSystemTime(&st);
  
    double dDate ;
    SystemTimeToJulianDate(&dDate, &st);
    
    JulianDateToSystemTime(&dDate , &stCheck);
 
    if(systemtime_to_date_str(&stCheck, lpcstrTime))
        printf("Today's date & time in your Origin custom date format(1) = \"%s\"\n",lpcstrTime);

}

Remark

See Also

SystemTimeToJulianDate

Header to Include

origin.h

Reference