4D v16.3SET DEFAULT CENTURY |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v16.3
SET DEFAULT CENTURY
|
SET DEFAULT CENTURY ( century {; pivotYear} ) | ||||||||
Parameter | Type | Description | ||||||
century | Longint |
![]() |
Default century (minus one) for entry of date with two-digit year | |||||
pivotYear | Longint |
![]() |
Pivot year for entry of date with two-digit year | |||||
The SET DEFAULT CENTURY command specifies the default century and the pivot year used by 4D when you enter a date with only two digits for the year.
The pivot year value defines the way 4D will interpret data entry of a date with a two-digit year:
By default, 4D sets the century to be the 20th century and uses 30 as pivot year. For example:
To change this default, execute the command. The effect of the command is immediate. You can pass a new default century only, or a new default century and a pivot year.
If you pass only a new default century minus one in century, 4D will interpret data entry of a date with a two-digit year as belonging to this century.
For example, after the call:
SET DEFAULT CENTURY(20) ` Switch to 21st century for default century
In addition, you can specify the optional pivotYear parameter.
For example, after this call, in which the pivot year is 1995:
SET DEFAULT CENTURY(19;95) ` Switch to 21st century for default century if year is less than 95
Note: This command only affects how 4D interprets dates entered with a two-digit year.
In all cases:
This command only affects data entry. It has no effect on date storage, computation, and so on.
Product: 4D
Theme: Date and Time
Number:
392
Modified: 4D v6.7
4D Language Reference ( 4D v16)
4D Language Reference ( 4D v16.1)
4D Language Reference ( 4D v16.2)
4D Language Reference ( 4D v16.3)