Convert Unix timestamp to or from Julian date.
double okutil_datetime_convert(double dVal, double dTimeZone, int nYear, bool bToJulian)
the converted value
EX1
void ts_test() { // convert Unix time 3419562484 (from the year 1900 instead of 1970) to Julian date in Beijing Time UTC+08:00 double dTS = 3419562484.0; double dTimezone = +08.00; int nYear = 1900; double dJD = okutil_datetime_convert(dTS, dTimezone, nYear, true); char str[128]; date_to_str_custom(dJD, "yyyy'-'MM'-'dd'T'HH':'mm':'ss+08:00", str); out_str(str); // "2008-05-12T14:28:04+08:00" }
origin.h