[FLOW3-general] DateTime limited to Unix timestamp?
Martin Kutschker
masi-no at spam-typo3.org
Thu Jul 1 19:13:18 CEST 2010
Am 01.07.2010 18:01, schrieb Michael Sauter:
> 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?
>>
>> The code already uses the PHP DateTime class and even though that
>> contains an (old) bug which limits the years to +/- 10,000 this would
>> mean a big step forward.
>>
>> It would be great to be able to store dates before 1901 and after 2038,
>> wouldn't it?
>
> Hi Jigal,
>
> I had a look at date & time in PHP recently and think the best way of doing it is the way FLOW3
> handles it.
>
> If I'm not mistaken, the unix timestamp is only limited to 2038 on 32-bit systems, not on 64-bit.
But that's not the only reason why you want to store date/time objects in a different format.
I'm not sure if I can store arbitrary objects in the DB in FLOW3 (in Extbase you can not), but let's
assume for now we can then I think there could be different date/time objects that behave like a PHP
DateTime but persiste differently. Or there is a special annotation that let's you choose between
different storage formats.
timestamp (Unix epoch), eg 1278003973
string (yyymmddThhmmss#oooo), eg 20040212T151921+0000
tzstring (yyymmddThhmmss(oooo)), eg 20040212T151921(0000)
"string" and "tzstring" differ in the way the time zone is handled. "string" uses a regular
approach, to get the UTC date/time you must add the offset. With "tzstring" the date/time *is* in
utc, the offset denotes only the TZ used when entering the TZ (which makes it possible to sort the
field in the DB.
If you want it more verbose we could add also this
iso8601, eg 2004-02-12T15:19:21+00:00
Though the support of microseconds in DateTime is far from optimal you might want to have also
format for that.
Masi
More information about the FLOW3-general
mailing list