home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Du Jour
/
SoftwareDuJour.iso
/
BUSINESS
/
DBASE
/
DBAPG.ARC
/
JUL2CAL.PRG
< prev
next >
Wrap
Text File
|
1984-08-12
|
1KB
|
47 lines
* Program.: JUL2CAL.PRG
* Author..: Anonymous, modified by Luis A. Castro
* Date....: 1/12/83, 11/20/83, 01/19/84
* Notice..: Copyright 1983 & 1984, Ashton-Tate, All Rights Reserved
* Version.: dBASE II, version 2.4x
¬ Notes...║ Julian t∩ calenda≥ date conversion.
* Local...: t:year, t:month, t:day, t:date, t:leapday
*
* IN: julian-N-6 Julian date.
* OUT: mdate-C-8 Calendar date in MM/DD/YY format.
*
STORE INT( julian / 365.26 ) + 1 TO t:year
STORE julian + INT( 395.25 - 365.25 * t:year ) TO t:day
STORE 1 TO t:leapday
*
* ---Calculate extra day for leap year.
IF INT(t:year/4) * 4 <> t:year
STORE 2 TO t:leapday
ENDIF
*
* ---Calculate actual number of days.
IF t:day > ( 91 - t:leapday )
STORE t:day + t:leapday TO t:day
ENDIF
*
* ---Calculate month, day, and year.
STORE INT( t:day / 30.57 ) TO t:month
STORE t:day - INT( 30.57 * t:month ) TO t:day
IF t:month > 12
STORE 1 TO t:month
STORE t:year + 1 TO t:year
ENDIF
STORE t:year - 1900 TO t:year
*
* ---Set-up the calendar date.
STORE STR(t:month,2)+"/"+STR(t:day,2)+"/"+STR(t:year,2) TO mdate
*
* ---Force leading zeroes.
STORE DATE() TO t:date
SET DATE TO &mdate
STORE DATE() TO mdate
SET DATE TO &t:date
*
RELEASE t:year,t:month,t:day,t:date,t:leapday
RETURN
* EOF: JUL2CAL.PRG