Showing dates in facets for dates before 1-1-1970 is wrong.

From PHP version 5.1.0 strtotime can return negative value for dates before 1-1-1970.

Mihajlo
Kontrola

CommentFileSizeAuthor
#6 strtotime-640706-6.patch709 bytespwolanin
formatisobygap.patch711 bytesmihha

Comments

robertdouglass’s picture

Does this patch make the pre 1970 dates display correctly? Or just prevent them from displaying wrongly?

mihha’s picture

It displays them correctly - they are showing like any other dates now.

robertdouglass’s picture

Gaaah. Drupal doesn't make it easy to test this. You can't, for example, simply change the authored field on a node to something prior to 1970, it won't validate.

mihha’s picture

Well.. I am using it for some CCK field. That's how I noticed this bug.

And here what changed in PHP so this is now supported:

Changelog for date function for v5.1.0

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.0 this range was limited from 01-01-1970 to 19-01-2038 on some systems (e.g. Windows).

Changlelog for strtotime function for v5.1.0

Now returns FALSE on failure, instead of -1.

pwolanin’s picture

Status: Needs review » Needs work

Based on the above changelog, looks like this patch is wrong - the condition should be :

$unix !== FALSE
pwolanin’s picture

Status: Needs work » Needs review
StatusFileSize
new709 bytes

like this

jpmckinney’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev
Status: Needs review » Fixed
jpmckinney’s picture

Version: 6.x-2.x-dev » 6.x-1.x-dev
Status: Fixed » Patch (to be ported)
jpmckinney’s picture

Status: Patch (to be ported) » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.