TCL

set-date-window command

.md

The set-date-window command allows specifying the rollover point on your system.

Syntax

 set-date-window {n} {(options)}

Parameter(s)

n Two-digit number specifying the rollover point (year).
  • If a non-numeric parameter is specified, an error message is returned.
  • If no parameter is specified, the currently set rollover point is returned.
options The following options are supported:
c Defines the century window to be used when converting a 2 digit year to 4 digits.
Note: The valid values for the century setting are only 19 (20th century) or 20 (21st century) with the 20th century window as the default setting.
i Suppress the output for this command.
x Indicates that the value specified in n is expressed in hexadecimal format.

Description

The rollover point determines the numeric cutoff for which century (20th or 21st) is being referred to when representing the year in 2-digit format within a program. For example, if the rollover point is set to 30 (the default), specifying a 2-digit representation of the year between 00 and 29 means you are referring to the years 2000 - 2029. Conversely, specifying a 2-digit representation of the year between 30 and 99 means you are referring to the years 1930 - 1999.

In addition to set the year window, you can also set the century window setting by using the (c option.

Century window <Year window >= Year window
set-date-window 19 (c 20xx (21st century) 19xx (20th century)
set-dete-window 20 (c 21xx (22nd century) 20xx (21st century)

Examples

Example 1

This example illustrates displaying the currently set rollover point. In this case, the default rollover point (30) is returned (as in, 01/01/1930).

>set-date-window
 Current Date Window:30

Example 2

This example illustrates setting the rollover point to 60 (as in, 01/01/1960).

>set-date-window 60
 Current Date Window:60

Example 3: Set year window to 20th century

:set-date-window 19 (c
Current Century Window: 19
:set-date-window
Current Year Window: 30
:date 11/11/33
November 11, 1933; Saturday internal: -12468 julian: 315
:date 11/11/28
November 11, 2028; Saturday   internal: 22231   julian: 316

Example 4: Set year window to 21st century

:set-date-window 20 (c
Current Century Window: 20
:set-date-window
Current Year Window: 30
:date 11/11/33
November 11, 2033; Friday internal: 24057 julian: 315
:date 11/11/28
November 11, 2128; Thursday   internal: 58755   julian: 316