Re: [Firebird-devel] GDS_EPOCH_START constant

2018-03-19 Thread Alex Peshkoff via Firebird-devel

On 03/18/18 23:16, Adriano dos Santos Fernandes wrote:

Is this constant correct?

// Number of the first day of UNIX epoch in GDS counting
enum { GDS_EPOCH_START = 40617 };

I see that for date 1970-01-01, Firebird stores it as 40587.


When counting days and month it's very easy to mix first day with zero 
day and first month with zero month. Why I type it - cause looks like 
that 30-day difference is to compensate such month in the only place 
where GDS_EPOCH_START is used currently - gds__trace(). What's funny is 
that something is anyway wrong with that code - from it's POV today is 
18 of March, not 19 ;)


I suggest you to drop both that wrong code (no need in signal safety 
since 2.5, i.e. it can be replaced with TimeStamp functions) and 
suspicious constant. Add instead one you need.




--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] GDS_EPOCH_START constant

2018-03-18 Thread Adriano dos Santos Fernandes
Is this constant correct?

// Number of the first day of UNIX epoch in GDS counting
enum { GDS_EPOCH_START = 40617 };

I see that for date 1970-01-01, Firebird stores it as 40587.


Adriano

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel