php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53299 strtotime expects date format to be MM/DD/YYYY even though timezone set to GMT
Submitted: 2010-11-12 14:02 UTC Modified: 2010-11-12 15:56 UTC
From: d dot reade at ReadesGroupServices dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.3.3 OS: CentOS 5.5
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: d dot reade at ReadesGroupServices dot com
New email:
PHP Version: OS:

 

 [2010-11-12 14:02 UTC] d dot reade at ReadesGroupServices dot com
Description:
------------
Using strtotime() to convert a UK date stamp (DD/MM/YYYY) but getting null or incorrect date.

Test script:
---------------
<?
ini_set('date.timezone', 'Europe/London');

$time = strtotime('31/08/2010');
$date = date('jS M Y', $time);

echo $date;
?>

Expected result:
----------------
31st Aug 2010

Actual result:
--------------
1st Jan 1970

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-11-12 15:56 UTC] derick@php.net
-Status: Open +Status: Bogus
 [2010-11-12 15:56 UTC] derick@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Timezones don't affect parsing formats. The formats used for parsing are always the same. You want to have a look at:
http://uk.php.net/manual/en/datetime.createfromformat.php
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 06 17:01:33 2025 UTC