GREGDT: Converting From Julian to Gregorian Format

How to:

The GREGDT function converts a date in Julian format (year-day) to Gregorian format (year-month-day).

A date in Julian format is a five- or seven-digit number. The first two or four digits are the year; the last three digits are the number of the day, counting from January 1. For example, January 1, 1999 in Julian format is either 99001 or 1999001; June21, 2004 in Julian format is 2004173.


Top of page

x
Syntax: How to Convert From Julian to Gregorian Format
GREGDT(indate, output)

where:

indate

I5 or I7

Is the Julian date. If the date is invalid, the function returns a 0 (zero).

output

I6, I8, I6YMD, or I8YYMD



Example: Converting From Julian to Gregorian Format

DTMDY converts NEWF (which was converted to the number of days by DAYMD) to the corresponding date and stores the result in a column with the format I8MDYY.

DTMDY(NEWF, 'I8MDYY')

For 81/11/02, the result is 11/02/1981.

For 82/05/01, the result is 05/01/1982.


iWay Software