Date handling
| From: | Ryan | Date: | Mon, 15 Nov 2004 20:05:09 +0000 |
| Subject: | Date handling | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-202082@lists.php.net to get a copy of this message | ||
Hello,
I would like to find out the 'official' way to handle dates in PHP. I am
aware of the limits on a Unix timestamp, but I am writing a financial
application that needs to deal with dates both before 1970 and after 2038
and of course have run into problems when trying to format those dates using
the date() and strftime() functions. This of course then also impacts
Smarty as Smarty's date_format modifier is just a wrapper around strftime().
I am looking at the PEAR Date module and that seems to resolve these issues,
but I would like to know if that is the standard/official way to handle
dates in PHP applications as in my application, I would like to have one
handler for dates, rather than separate code for dates within the Unix
timestamp range and for dates outside - so if I switch to PEAR Date, I will
use it everywhere in my code since I cannot take any chance of using date()
or strftime() and possibly getting invalid data.
Additionally, are there any plans to make an official PHP date extension
that handles dates outside a Unix timestamp range as something built into
the language itself rather than as a '3rd party extension' which the PEAR
Date module appears to be since it's not in the core PHP language?
Thanks,
Ryan