SET CENTURY Command

Determines whether Microsoft Visual FoxPro displays the century portion of date expressions and how Visual FoxPro interprets dates that specify only 2 digit years.

SET CENTURY ON | OFF | TO [nCentury [ROLLOVER nYear]]

Parameters

ON

Specifies a four-digit year in a format that includes 10 characters (including date delimiters).

NoteNote

To provide year 2000 compliance, it's recommended that you always set SET CENTURY to ON.

OFF

(Default) Specifies a two-digit year in a format that includes eight characters and assumes the twentieth century for date calculations.

TO nCentury

A number from 1 to 99 that specifies the current century. When a date has a two digit year, nCentury determines in which century the year occurs. The ROLLOVER value determines whether the year is in nCentury or the century following nCentury.

ROLLOVER nYear

A number from 0 to 99 that specifies the year equal to and above which is the current century and below which is the next century. The default value for nYear is the last two digits of the current year plus 50 years - if the current year is 1998, nYear is 48, the last two digits of 2048 (1998 + 50).

Note that the rollover value only determines the century for a date entered without a century portion - an ambiguous date format that is not recommended.

For example, if the current year is 1998 and nYear is the default (48), any date entered without a century portion and a year of 48 or greater is considered to be in the current century (the 20th century). Any date entered without a century portion but with a year before 48 is considered to be in the next century (the 21st century).

Expand imageRemarks

Expand imageSee Also


© , 1996-2020 • Updated: 11/10/20
Comment or report problem with topic