Chapter 72. SBLDateLib
This provides a set of SBL-compatible functions for working with dates (the SBL versions used the $ sign in the name, which is not permitted in SIMPOL, so these are replaced by the letters STR): DAY, DAYS, DAYSTR(), MONTH(), MONTHSTR(), YEAR(), and DATESTR(). It also supplies a function for converting from a string to a date string2date().
DATESTR()
Description
Like all of the functions that are named with all capital letters, this
function was designed to provide a drop-in replacement for the Superbase
BASIC Language function of the same name DATE$()
. As
such it has a few idiosyncracies, just like the original. If the
format
parameter contains a comma or four
m
characters such that the date will be output with
the name of the month spelled out, then the return value will have a
leading space prepended. If a comma is included, then the output will
contain a comma plus a space. The supported pattern character
combinations are:
dd – Numeric representation of the day of the month, without leading zeros
0d – Numeric representation of the day of the month, with leading zeros
mm – Numeric representation of the month, without leading zeros
0m – Numeric representation of the month, with leading zeros
mmm – Three-letter abbreviation for the name of the month
mmmm – Full name of the month
yy – Year represented by only the last two digits
yyyy – Year represented by all four digits
Typical pattern strings are:
"dd/mm/yy"
"0d/0m/yy"
"mm/dd/yy"
"0m/0d/yy"
"yyyy0m0d"
"dd mmmm,yyyy"
Prototype
DATESTR
(
date
,
string dt
,
SBLlocaledateinfo format
)
ldiLocale
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
dt | None | date | |
format | None | string | |
ldiLocale | None | SBLlocaledateinfo |