SetEpoch Function | |
Return and optionally change the setting that determines how dates without century digits are interpreted.
Namespace:
XSharp.Core
Assembly:
XSharp.Core (in XSharp.Core.dll) Version: 2.21
Syntax FUNCTION SetEpoch() AS DWORD
public static uint SetEpoch()
Request Example
View SourceReturn Value
Type:
DWord
If
lNewSetting is not specified, SetEpoch() returns the current setting.
If
lNewSetting is specified, the previous setting is returned.
Remarks
SetEpoch() is an environment function that determines the interpretation of date strings containing only two year digits. When such a string is converted to a date value, its year digits are compared with the year digits of nNewSetting.
If the year digits in the date are greater than or equal to the year digits of nNewSetting, the date is assumed to fall within the same century as nNewSetting.
Otherwise, the date is assumed to fall in the following century.
Examples
This example shows the effects of SetEpoch():
1SetDateFormat("mm/dd/yyyy")
2? CTOD("05/27/1904")
3? CTOD("05/27/67")
4? CTOD("05/27/04")
5SetEpoch(1960)
6? CTOD("05/27/1904")
7? CTOD("05/27/67")
8? CTOD("05/27/04")
See Also