Re: Calendar/Date
| From: | Paul M Foster | Date: | Wed, 18 Mar 2009 16:14:12 +0000 |
| Subject: | Re: Calendar/Date | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-290245@lists.php.net to get a copy of this message | ||
On Wed, Mar 18, 2009 at 11:46:31AM -0400, Bob McConnell wrote:
> From: Paul M Foster
<snip>
>
> You also need to be aware that on 32 bit Unix and Linux systems the
> behavior of mktime() on dates after Jan 18, 2038 is undefined. The 32
> bit counter overflows early on the 19th, so any value returned is
> invalid. This is not a problem on 64 bit systems.
>
> We ran into this recently because Support was defining "never expire" as
> Today plus 30 years. A couple of sites started reporting problems about
> two months ago.
This is why I normally never use the time functions in PHP. Instead, I
wrote a date class that uses Julian days internally and doesn't consult
PHP time functions. When I need some odd thing (like the date for the
end of the week), I just add it as a member to the date class. Plus,
PHP's date objects are woefully unfeatureful. If someone asks on the
list for a solution, I can use the PHP time functions for advising them,
but I don't personally use them.
Paul
--
Paul M. Foster