xHarbour Reference Documentation > Command Reference |
Determines the interpretation of date values without century digits.
SET EPOCH TO <nYear>
The SET EPOCH command determines the interpretation of date strings that do not carry century digits. Conversion functions such as CtoD() use the value of <nYear> as reference for a century. When decade and year of the string value to convert are larger than or equal to the last two digits of <nYear>, the value is assumed to fall into the same century like <nYear>. When the value is smaller, it is assumed to fall into the next century.
By default, SET EPOCH is 1900 so dates without century digits will fall into the twentieth century. xHarbour supports dates from 01/01/0100 to 12/31/2999.
See also: | CtoD(), Date(), DtoC(), DtoS(), Set(), SET CENTURY, SET DATE |
Category: | SET commands |
Source: | rtl\set.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example demonstrates the effect or a reference year set with // SET EPOCH: PROCEDURE Main SET DATE FORMAT TO "mm/dd/yyyy" ? CtoD("05/27/1903") // Result: 05/27/1903 ? CtoD("05/27/55") // Result: 05/27/1955 SET EPOCH TO 1950 ? CtoD("05/27/1910") // Result: 05/27/1910 ? CtoD("05/27/69") // Result: 05/27/1969 ? CtoD("05/27/06") // Result: 05/27/2006 RETURN
http://www.xHarbour.com