Please enable JavaScript to view this site.

ASQL Reference

Navigation: » No topics above this level «

DSTOI

Scroll Prev Top Next More

Reviewed and revised April 2024

xcall DSTOI, xdate

DSTOI converts a separated date (which is the format returned by the DATE system function in BASIC) into a Julian date which starts with 1/1/1900. You can use ODTIM or DATES to convert the Julian date back to various separated and printable formats.  

Parameters

xdate  (Structure)  [in/out]

A separated date for the input data, overlaid with a B,4 variable for the output (Julian) date, mapped as follows:

MAP1 xdate

  MAP2 mon,B,1        ! Month 1-12

  MAP2 day,B,1        ! Day 1-31

  MAP2 yr,B,1         ! Year-1900

  MAP2 dow,B,1        ! Day of week (0=Mon, 6=Sun)

MAP1 jdate,B,4,@xdate  ! # days since 1/1/1900

 

Example

xdate = DATE           ! load Xdate with separated date

xcall DSTOI, xdate     ! convert Xdate from separated to Julian

print "Julian date is: ";jdate