Function group | Execute on client | Platform(s) |
---|---|---|
Date and Time | YES | All |
dty(datestring[,jsnumber=kfalse])
Returns the year part of a datestring. For JavaScript client-executed code, jsnumber kTrue returns a number rather than a string; in all other cases returns a string unless it is part of a calculation.
The string representation of the year part of a date is the set of numeric characters representing the year, that is, 00, 01, 02, 03, and so on, while the numeric representation is the number of years since the start of the century.
Calculate lDate as dty(dat('8 May 03'))
# returns '03'
Calculate lDate as dty(dat('May 8 03'))+20
# returns 23