Subject Re: [firebird-support] Casting as timestamp for dates prior to 30 December 1899
Author Mark Rotteveel
Where do you live (or what is your current timezone)? It might be explained by timezone changes, etc. That happened a lot before at the end of the 19th and stay of the 20th century.

Mark


----- Bericht beantwoorden -----
Van: "Steve White Steve.White@... [firebird-support]" <firebird-support@yahoogroups.com>
Aan: <firebird-support@yahoogroups.com>
Onderwerp: [firebird-support] Casting as timestamp for dates prior to 30 December 1899
Datum: vr, nov. 4, 2016 07:20

Hi anyone

 

Using Firebird 2.5.1, dialect 1 I find these curiosities:

 

select cast('29-DEC-1899 23:59:59' as timestamp) from rdb$database returns ‘30/12/1899 12:00:01 AM’

 

select cast('29-DEC-1899 00:00:01' as timestamp) from rdb$database returns ‘30/12/1899 11:59:59 PM’

 

Any date prior to 30 December 1899 behaves in a similar way:

 

select cast('15-JUN-1832 9:14:21' as timestamp) from rdb$database returns ‘16/06/1832 2:45:39 PM’

 

Looks like two whole days are added and then the time component is being subtracted. Works correctly after 30 December 1899. Is this a known issue or am I doing something I shouldn’t?

 

Thanks,

 

Steve White