[TYPO3-dev] timestamps and dates before 1970
Martin Seebach
martin at biplane.dk
Thu Jan 5 14:41:09 CET 2006
tor, 05 01 2006 kl. 09:14 +0100, skrev Martin Kutschker:
> Christoph Koehler schrieb:
> > Hey all,
> >
> > I was just wondering what the 'official' typo3 way to make timestamps
> > before 1970 (for birthdays, or other dates like anniversaries etc) is.
>
> There is none. The last discussions on this list brought no resolution
> on what would be th best way.
If I recall correctly, this discussion was on how arbitrary dates could
be stored (eg. also historic and science fiction events), and there was
never any real consensus.
But solely for birthday purposes, the PHP-way must be the official way:
$ php -r 'print(strtotime("1960-12-21 23:10:15")."\n");'
-284867385
$ php -r 'print(date("Y-m-d H:i:s",-284867385)."\n");'
1960-12-21 23:10:15
This works back to sometime in 1901.
// Martin Seebach
More information about the TYPO3-dev
mailing list