php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33288 strtotime() error on dates ranging from 2006-05-01 to 2006-05-31 with Swedish.
Submitted: 2005-06-09 22:45 UTC Modified: 2005-06-09 23:15 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: henke at mac dot se Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.0.4 OS: Win 2003 Server
Private report: No CVE-ID: None
 [2005-06-09 22:45 UTC] henke at mac dot se
Description:
------------
Using strtotime() funktion on dates between 2006-05-01 to 
2006-05-30 always returns -1.

This issue only affects May dates in 2006 which is weird.

Reproduce code:
---------------
strtotime('24 May 2006 0:00');

Tested only with swedish localisation so you could try

setlocale(LC_TIME,'swedish');
strtotime('24 Maj 2006 0:00');

Expected result:
----------------
A unix timestamp

Actual result:
--------------
-1

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-06-09 22:55 UTC] henke at mac dot se
Only effects Swedish dates. i.e. '24 Maj 2006'
 [2005-06-09 23:09 UTC] derick@php.net
strtotime doesn't care about locales, and it won't work. Using the english name works fine here:

<?php
echo strtotime('24 May 2006 0:00');
?>
1148421600

 [2005-06-09 23:15 UTC] henke at mac dot se
Yepp I realized that. The darn dates are outputted from MSSQL 
DB and it work when using PHP 4.3 but when they upgraded to 
Win 2003 and PHP 5.04 I guess the ouput changed from 24 May to 
24 Maj when retrieving from db.

I'm going to bark up another tree now!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jun 16 01:01:29 2024 UTC