# DSTOI

> [HTML Version](dstoisbr.htm)

_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](odtim_sbr.md) or [DATES](datessbr.md) to convert the Julian date back to various separated and printable formats.  

**Parameters**

_xdate_  ([Structure](structure.md))  \[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

