Module date

Module date 

Source
Expand description

Date formatting and parsing helpers. Pan date formatting and parsing built on Julian day numbers. Day format is days between 1/1/4713 BC and the given date, with adjustment for Gregorian calendar.

Functions§

completedatestr
Formats date with weekday and long date.
date
Parses a human-friendly date string into a Pan JDN value.
datepattern
Formats date using a Pan date pattern.
datestr
Formats date as m/d/yy.
datevalue
Converts a year-month-day date into a Pan JDN value. Gregorian calendar begins at 1582-10-15; dates 1582-10-05..14 are rejected.
dayofweek
Returns the day of week for date (Sunday = 0, Saturday = 6).
daystr
Returns the full weekday name for date.
dayvalue
Returns the day of month for date.
eurodatestr
Formats date as dd-MON-YYYY. e.g. 20-APR-2003
longdatestr
Formats date as Month ddnth, yyyy.
month1st
Returns the first day of the month containing date.
monthlength
Returns the number of days in the month containing date.
monthmath
Adds offset months, clamping the day to the new month length.
monthvalue
Returns the month number for date (1-12).
naturaldatestr
Formats a date with a short, friendly representation.
quarter1st
Returns the first day of the quarter containing date.
quartervalue
Returns the quarter number (1-4) for date.
regulardate
Extracts the date component from a superdate timestamp.
regulartime
Extracts the seconds-since-midnight from a superdate timestamp.
superdate
Combines a date and seconds into a superdate timestamp.
superdatepattern
Formats a superdate using separate date and time patterns.
superdatesecondsstr
Formats a superdate including seconds.
superdatestr
Formats a superdate as m/d/yy h:mm AM/PM.
supernow
Returns the current local time as a superdate timestamp.
today
Returns today’s local date as a Pan JDN value.
week1st
Returns the first day of the week containing date (Sunday start).
weekvalue
Returns the 1-based week number within the year.
year1st
Returns the first day of the year containing date.
yearvalue
Returns the year for date.
ymd_from_date
Converts a Pan JDN value into year, month, and day. Before 1582-10-15 dates are in Julian calendar.

Type Aliases§

PanDate
A Pan date represented as a Julian day number (JDN).
PanSuperDate
A combined date/time stored as seconds since the Pan superdate epoch.