[TYPO3-core] Patch: Fix Timezone date problems
Karsten Dambekalns
karsten at typo3.org
Fri Jan 20 14:37:14 CET 2006
Hi.
On Friday 20 January 2006 01:38, Bernhard Kraft wrote:
> Karsten Dambekalns wrote:
> > I clearly remember the discussion about adding some enahnced date
> > handling functions to deal with dates before 1970...
>
> When outputting negative timestampt no special care must be taken.
Fromthe PHP manual:
Note: The valid range of a timestamp is typically from Fri, 13 Dec 1901
20:45:54 GMT to Tue, 19 Jan 2038 03:14:07 GMT. (These are the dates that
correspond to the minimum and maximum values for a 32-bit signed integer).
However, before PHP 5.1 this range was limited from 01-01-1970 to 19-01-2038
on some systems (e.g. Windows).
So if we just use date(), mktime() etc. this *may* fail. But anyway, this is
good enough. If we needed dates after 2038, we'd still need to include
something like ADOdb time library, but...
Now to the patch. This call intval() twice, why not add else?
---- snip ----
if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['respectTimeZones'] &&
intval($value)) {
$value = t3lib_div::timestamp_GMT2local(intval($value));
}
$value = intval($value);
---- snip ----
Since I didn't test it, no +1, but I like the idea.
Karsten
PS: Your signature was bad...
--
Karsten Dambekalns
TYPO3 Association - Active Member
http://association.typo3.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 307 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20060120/3cc61edf/attachment.pgp
More information about the TYPO3-team-core
mailing list