php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34571 strptime cannot parse %z
Submitted: 2005-09-21 03:49 UTC Modified: 2005-09-29 01:00 UTC
From: o dot persson at gmail dot com Assigned:
Status: No Feedback Package: Date/time related
PHP Version: 5.1.0RC1 OS: Debian GNU/Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2005-09-21 03:49 UTC] o dot persson at gmail dot com
Description:
------------
It doesn't work with %z. %Z, or no %z works.


Reproduce code:
---------------
<?php
$format = '%Y-%m-%d %H:%M:%S %Z';
$strf = strftime($format);
var_dump(strptime($strf, $format));
?>


Expected result:
----------------
An array with the date parsed.

Actual result:
--------------
False.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-09-21 09:24 UTC] derick@php.net
Works fine here with 5.1.0RC2 and 6.0.0dev:

array(9) {
  ["tm_sec"]=>
  int(16)
  ["tm_min"]=>
  int(23)
  ["tm_hour"]=>
  int(9)
  ["tm_mday"]=>
  int(21)
  ["tm_mon"]=>
  int(8)
  ["tm_year"]=>
  int(105)
  ["tm_wday"]=>
  int(3)
  ["tm_yday"]=>
  int(263)
  ["unparsed"]=>
  string(4) "CEST"
}

perhaps you have an old glibc, which one do you use? Also, try the latest snapshot off http://snaps.php.net.
 [2005-09-29 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC