Template:Datetime and format examples
YYMMDD | This is the common six-digit date format which supports sort order if all dates are within a single century.
The following SOUL code fragment prints the value If $sir_date2nd('960229', 'YYMMDD') > -9E12 Then Print 'OK' End If
For Sir2000 User Language Tools users, the following statement prints the value print $sir_datechk('YYMMDD', '960229') |
---|---|
YYYYMMDD | This is the common eight-digit date format which supports sort order with dates in two centuries.
The following SOUL code fragment prints the value %n = $sir_date2nd('921212', 'YYMMDD') Print $sir_nd2date(%n, 'YYYYMMDD')
For Sir2000 User Language Tools users, the following statement prints the value print $sir_datecnv('YYMMDD', 'YYYYMMDD', '921212') |
MM/DD/YY | This is the U.S. six-digit date format for display. The value 12/14/97 matches this format.
The following SOUL code fragment prints the value If $sir_date2nd('12/14/94', 'MM/DD/YY') > -9E12 Then Print 'OK' End If
For Sir2000 User Language Tools users, the following statement prints the value print $sir_datechk('MM/DD/YY', '12/14/94')
|
DD.MM.YY | This is a European six-digit date format for display. The value 14.12.97 matches this format.
The following SOUL code fragment prints the value If $sir_date2nd('14.12.94', 'DD.MM.YY') > -9E12 Then Print 'OK' End If
For Sir2000 User Language Tools users, the following statement prints the value print $sir_datechk('DD.MM.YY', '14.12.94')
|
Wkday, DAY Month YYYY "A"T HH:MI | This is a format that could be used for report headers.
The following SOUL statement prints a value like print $sir_date('Wkday, DAY Month YYYY "A"T HH:MI')
|
YYIIII | This format might be used for data that contains a two-digit year prefixing other information, such as a sequence number. The value 92A123 matches this format.
The following SOUL code fragment prints the value %d = $sir_date2nd('92ABCD', 'YYIIII') Print $sir_nd2date(%d + 10*365.25, 'YY')
For Sir2000 User Language Tools users, the following statement prints the value print $sir_datecnv('YYIIII', 'YYYYIIII', '92ABCD') Note: When a pair of format strings are used for transforming date values, for example for $Sir_DateCnv or processing of updates to SIRFIELD RELATE fields, both formats must have the same number of I tokens. The $functions with both an input and output format, for example $Sir_DateCnv, are only available in the Sir2000 User Language Tools; SIRFIELD is part of the Sir2000 Field Migration Facility. |
YY* | This format might be used for data that contains a two-digit year prefixing other information, such as a sequence number, when the other information is variable length. The values 92 and 92ABC123 match this format.
The following SOUL code fragment
prints the values If $sir_date2nd('92', 'YY*') > -9E12 Then Print 'OK' End If IF $sir_date2nd('1992ABC', 'YYYY*') > -9E12 THEN Print 'OK' End If
For Sir2000 User Language Tools users, the following statements print the values print $sir_datecnv('YY*', 'YYYY*', '92') print $sir_datecnv('YY*', 'YYYY*', '92XYZ')
|
CYYDDD | This is a compact six-digit date format with explicit century information, from 1900 through and including 2899. The value 097031 (representing 31 January 1997) matches this format.
The following SOUL fragment prints the value If $sir_date2nd('097031', 'CYYDDD') > -9E12 Then Print 'OK' End If
For Sir2000 User Language Tools users, the following statement prints the value print $sir_datechk('CYYDDD', '097031') |
ZYYMMDD | This is a compact six- or seven-digit date format with explicit century information, from 1900 through and including 2899, that can often be used with "old" YYMMDD date values in the 1900s. The values 970501 (representing 1 May 1997) and 1000501 (representing 1 May 2000) match this format.
The following SOUL fragment prints the values * Check 1 Dec, 1997: If $sir_date2nd('971201', 'ZYYMMDD') > -9E12 Then Print 'OK' End If * Check 1 Dec, 2000: If $sir_date2nd('1001201', 'ZYYMMDD') > -9E12 Then Print 'OK' End If
For Sir2000 User Language Tools users, the following statements print the values * Check 1 Dec, 1997: print $sir_datechk('ZYYMMDD', '971201') * Check 1 Dec, 2000: print $sir_datechk('ZYYMMDD', '1001201')
|
YY0000 | Decimal digits can be used as separator characters. The value 980000 matches this format.
The following SOUL fragment prints the value %n = $sir_date2nd('92000', 'YY000') Print $sir_nd2date(%n, 'YYYY"N"A')
For Sir2000 User Language Tools users, the following SOUL statement prints the value Print $sir_datecnv('YY0000', 'YYYY"N"A', '920000') Note: Numeric separators, unlike alphabetic separators, do not need to be preceded by a double-quote character ("). |