Epoch

<< Click to Display Table of Contents >>

Navigation:  Apollo VCL Components > Apollo VCL Component Reference > TApolloEnv > TApolloEnv Properties >

Epoch

Declaration

property Epoch: Integer;

Description

Sets or gets a numeric value indicating the base yaer of a 100-year period in which all dates containing only two year digits are assumed to fall.

 

The epoch setting determines the interpretation of date strings with only two year digits. When such a string is converted to a date value, its year digits are compared with the year digits of the Epoch property value. If the year digits in the date are greater than or equal to the year digits of Epoch, the date is assumed to fall within the same century as Epoch. Otherwise, the date is assumed to fall in the following century.

 

The default epoch value is 1980, causing dates with no century digits to be interpreted as falling within the twentieth century.

Delphi Example

with ApTbl do

begin

 ApolloEnv1.Century := True; 

 s1 := EvalString( 'CTOD( "05/27/1904" )' ); // 05/27/1904

 s2 := EvalString( 'CTOD( "05/27/67" )' ); // 05/27/2067

 s3 := EvalString( 'CTOD( "05/27/04" )' ); // 05/27/2004

 

 ApolloEnv1.Epoch := 1960;

 s4 := EvalString( 'CTOD( "05/27/1904" )' ); // 05/27/1904

 s5 := EvalString( 'CTOD( "05/27/67" )' ); // 05/27/1967

 s6 := EvalString( 'CTOD( "05/27/04" )' ); // 05/27/2004

end;

See Also

SetEpoch, Century