php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43555 strtotime not parsing UK date format (dd/mm/yyyy)
Submitted: 2007-12-10 16:47 UTC Modified: 2007-12-10 18:33 UTC
From: tim dot kay at mailshack dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.2.5 OS: Windows 2003 SP2
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: tim dot kay at mailshack dot com
New email:
PHP Version: OS:

 

 [2007-12-10 16:47 UTC] tim dot kay at mailshack dot com
Description:
------------
strtotime does not parse a date in UK format properly.  

Server locale (in Windows) is set to English (United Kingdom) in all places configurable.

The following line of code:
echo setlocale(LC_ALL, ''); 

Comes back with the following result:
English_United Kingdom.1252

I am running Apache 2.2.6.

Reproduce code:
---------------
$mydate = strtotime("20/11/2007");
echo $mydate."<br/>";
echo date("Y-M-d h:i:s", $mydate);

Expected result:
----------------
1195516800
2007-Nov-20 12:00:00


Actual result:
--------------
1970-Jan-01 01:00:00


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-12-10 18:33 UTC] derick@php.net
strtotime() is not locale dependent, and simply not all formats are supported-the UK date format is one of those apparently. Some functionality to parse formats with a given format might follow in the future.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 07 10:01:34 2025 UTC