Consultor Eletrônico



Kbase 6420: How to Obtain a Julian Date in Progress
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   16/10/2008
Status: Verified

GOAL:

How to convert the current date and time to Julian format.

FIX:

A Julian date is a decimal number that represents an exact time in the following format:
YYDDD.TTTT where YY = two digits of current year
DDD = Number of days since January 1
TTTT = Decimal fraction representing current
Time of day to total time in day.

For example:

Wednesday July 1, 1992 at 9:31:05 AM converts to 92182.3966
in Julian.

The following PROGRESS code will convert current date and time to
Julian format:

define variable JULIAN-DATE as decimal decimals 4 format "zzzz9.9999".
/* Assumes current century, 86400 is number of seconds in a day */
assign JULIAN-DATE = ((year(today) - 1900) * 1000) +
today - date(1,1,year(today)) + time / 86400.