Consultor Eletrônico



Kbase 12149: Convert from Julian to MM/DD/YY
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   16/09/1998
Convert from Julian to MM/DD/YY

To convert a julian date to mm/dd/yy format, use the following code:


DEF VAR juldate AS INTEGER INIT 93183.
DEF VAR ndate AS DATE.
DEF VAR ndays AS INTEGER.
DEF VAR year_offset AS INTEGER.

ndays = juldate MOD 1000.
year_offset = TRUNC(juldate / 1000, 0).
ndate = DATE("01/01/" + STRING(year_offset)) + ndays - 1.

DISPLAY ndate FORMAT "99/99/99". /* or "99/99/9999" */


Progress Software Technical Support Note # 12149

(EAG & JMA Rev. 9/98)