Alternate entries: GT.DAT
B: status = getdate( string [, tense] ); C: int getdate(const char *string [, int tense] );
For example, suppose string is "January 10". If "tense" is -1, GETDATE interprets this as last January 10; if "tense" is +1, GETDATE interprets this as next January 10; if "tense" is 0, GETDATE interprets this as whichever January 10 is closer to today.
GETDATE attempts to convert the ASCII date in "string" into the form "mm/dd/yy". GETDATE allows for a great deal of variation in the input format of "string", and will recognize the months of the year spelled out, abbreviated, or in roman numerals. GETDATE also recognizes correct ordinal suffixes, definite articles, and prepositions.
If "string" does not contain a recognizable year, GETDATE will supply one based on the argument "tense".
Below we list some examples of GETDATE. In all cases, "tense" is assumed to be zero.
In 1999: string changed to: status 012181 01/21/81 3 02 11 1965 02/11/65 2 sep 3 09/03/99 3 garbage garbage 0 3 blat 56 3 blat 56 0 on nov the 1st 11/01/99 3 5th of july 1970 07/05/70 3
This version of GETDATE is written by using the .TOSEC function. For full information on the types of date strings recognized by GETDATE, see "expl b lib .tosec". However, since GETDATE is only concerned with dates, none of the .TOSEC features related to time of day may appear in "string". Furthermore, GETDATE does not accept relative dates, such as "10 days ago".
Earlier versions of GETDATE did not use .TOSEC; therefore there are subtle differences between the current version of GETDATE and earlier versions. In particular, earlier versions handled "tense" differently:
In addition, GETDATE used to accept dates that used the colon (:) character, as in 99:12:25 for Christmas, 1999. This construction is no longer valid, since .TOSEC associates the colon exclusively with times.
Copyright © 2000, Thinkage Ltd.