date_frjul()

Converts a Julian date to a date string

Call  
#include <vv_sys.h>
int date_frjul(date_stp, jul_date, format_stp)

UCHAR *date_stp

String to copy converted date to

long jul_date Julian date
UCHAR *format_stp Date format string
Description of Parameters

format_stp: Specify SYSDATEFMT (the global system date format), US_DATE ("MM/DD/YY"), EURO_DATE ("DD/MM/YY"), or your own date format string. A date format string is composed of the following characters:

D Represents numeric day (i.e., 22). There can only be 2 Ds in the string.
M Represents numeric month (i.e., 12). There can only be 2 Ms in the string.
S Represents the string month (i.e., Mar or March depending on the number of Ss). There must be at least three Ss in the string so that the month can be uniquely specified.
Y Represents the numeric year. There can be 2 or 4 Ys in the string..
Any other character, including spaces, may be used as separators between the components. The separators are optional.
Returns
1 The Julian date was successfully converted to a date string of the specified format
0 The specified Julian date is invalid
Description

A Julian date is the number of days elapsed since a certain reference time in the past. The reference time from which all Julian days are measured has been chosen by astronomers to be January 1, 4713 B.C.

Use date_frjul() to convert the Julian date to a date string using the specified format string. The Julian date is converted to the corresponding day, month, and year and then date_frnums() builds the date string based on the specified date format.

Julian dates less than 1721120L (corresponding to March 1, 0 A.D.) cannot be converted.

Related Functions

date_tojul(), date_frnums()

Cautions

The date string must be large enough to hold the formatted date string, including the separators and a null terminator '/0'.

Only Julian dates equal to or larger than 1721120L (corresponding to March 1, 0 A.D.) are converted correctly. An invalid Julian date (zero return) is not considered a fatal error. VV_ERR does not get set; therefore, the VCS error reporting system does not report this condition.


Home Contents Previous Next