Julian dates represent the number of days elapsed since a certain reference date in the past. The reference date from which all Julian dates are measured has been chosen by astronomers to be January 1, 4713 B.C. Julian dates are used for comparing dates and to store dates as a long integer value instead of a string.
To convert a date to a Julian date, call the date to Julian function, date_tojul():
|
||
|
|
|
|
|
|
date_tojul() returns the Julian date as a long integer.
To convert a Julian date back to a date string, call the date from Julian function, date_frjul():
|
||
|
|
|
|
|
|
|
|
|
date_frjul() places the resulting date string, formatted according to the specified format string, in the pointer to the date string passed in the call.
Note that you must allocate memory for the string used to receive the formatted date. This string must be long enough to accept a date of the specified format.