utcdate.wbb - Convert Text Date to Internal Julian Integer Or Date/Time Number


CALL "utcdate.wbb",strdate$,juldate


This low-level routine is used to convert a text string to a julian date value. The current Business BASIC default date format is used to determine whether the format is month-day-year, or day-month-year, and the text string is parsed.




Text string containing the date to be converted.


Julian date value of the text string.

In BBx and PRO/5, the value of STBL("!DATE") is used for this analysis and the following steps are performed:

  1. If strdate$ is blank, a julian number of 0 is returned.

  2. If strdate$ is "@", today's date and time are returned.

    If a time is found at the end of strdate$, it is analyzed and converted to a fraction of a day (noon is .5, 6:00 pm is .75) to be added to the julian integer. The time must be in the format h:mm and may be followed by a word starting with "p" to force a "pm" assumption.

    If possible, month names are replaced with month numbers.

    strdate$ is tested for simple numeric dates, such as 030196 or 11301995, and converted to a julian value.

    Finally, strdate$ is scanned for three numerics, separated by any non-numeric delimiter, such as 3/1/96 or 11-30-1995, and converted to a julian number. If no year is found, the current year is assumed. If the conversion cannot be performed, the juldate value is returned as 0.