[FLOW3-general] DateTime limited to Unix timestamp?

Jigal van Hemert jigal at xs4all.nl
Thu Jul 1 21:12:23 CEST 2010


Michael Sauter wrote:
> On 01.07.10 14:00, Jigal van Hemert wrote:
>> If I read it correctly, FLOW3 still uses the Unix timestamp to store
>> dates. Wouldn't this be a good opportunity to move to a 64-bit format?
> I had a look at date & time in PHP recently and think the best way of 
> doing it is the way FLOW3 handles it.

You mean handling it as a (internally 64-bit) DateTime object in PHP and 
storing it in the database as a 32-bit number? Hmm...

> If I'm not mistaken, the unix timestamp is only limited to 2038 on 
> 32-bit systems, not on 64-bit. And here's hope there won't be any 32-bit 
> systems around in 28 years ;) 

Storing a timestamp in an INTEGER field in the database will limit it to 
4 bytes (if I understood the ANSI specs correctly the range defined for 
a normal INTEGER is the same as that of a 32-bit signed integer). 
Database systems have invented 8 byte numbers for some time, so these 
could be used for bigger timestamps.

Thinking that a system will be replaced in x years is something that was 
proven wrong a little over a decade ago.

The most important issue is that it's not about 32-bit versus 64-bit 
*systems*. A Unix timestamp will suffice for some time to store creation 
dates of files (for which it was meant), but what about birthdays of 
historical figures? Events in the past and future like solar eclipses [1]?

> There's still the problem with dates before 1970 (not 1901) though ...

Well, I'm not the only person in the world who's been born before that year.

It would be rather strange for a brand new system from the 21th century 
which uses cutting edge technology to support only dates between 1970 
and 2038, wouldn't it?

[1] http://eclipse.gsfc.nasa.gov/SEcat5/SE2901-3000.html

-- 
Jigal van Hemert
skype:jigal.van.hemert
msn: jigal at xs4all.nl
http://twitter.com/jigalvh


More information about the FLOW3-general mailing list