Click or drag to resize

SetCentury Function (Logic)

X#
Return and optionally change the setting that determines whether to include or omit century digits in the date format.

Namespace:  XSharp.Core
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.19
Syntax
 FUNCTION SetCentury(
	lNewSetting AS LOGIC
) AS LOGIC
Request Example View Source

Parameters

lNewSetting
Type: Logic
TRUE includes century digits, meaning the date format contains four digits for the year and can include a century other than 19xx. FALSE omits century digits, meaning the date format contains only two digits for the year.
This means that century digits of dates are not displayed and cannot be input.
The initial default is TRUE.

Return Value

Type: Logic
If lNewSetting is not specified, SetCentury() returns the current setting.
If lNewSetting is specified, the previous setting is returned.
Remarks
SetCentury() modifies the current date format as set by SetDateFormat(). Note that only the display and input format of dates is affected; date calculations maintain the century information regardless of the date format.
Examples
This example shows the results of a simple SetCentury function:
X#
1SetCentury(FALSE)
2? TODAY()                    // 06/15/93
3SetCentury(TRUE)
4? TODAY()                    // 06/15/1993
See Also