php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #29595 strtotime can't interpret postgres "timestamp" values
Submitted: 2004-08-10 07:24 UTC Modified: 2005-07-11 09:08 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: phpbugs at blackbird dot net dot au Assigned: derick (profile)
Status: Closed Package: Feature/Change Request
PHP Version: 4.3.8 OS: FreeBSD 5.2.1
Private report: No CVE-ID: None
 [2004-08-10 07:24 UTC] phpbugs at blackbird dot net dot au
Description:
------------
I'm not sure whether this is strictly speaking a bug or a feature request, but strtotime doesn't seem to be able to interpret the output from a PostgreSQL 7.3.3 "timestamp" field.

Reproduce code:
---------------
<?php

$from_postgres = '2004-08-09 14:48:27.304809+10';

echo strtotime($from_postgres);

?>


Expected result:
----------------
It should print the unix timestamp for the given date.

Actual result:
--------------
int(-1)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-08-10 08:54 UTC] derick@php.net
It's a feature request (and this is already working in the new date/time parsing routines for 5.1.x)
 [2005-07-11 09:08 UTC] derick@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

Fixed for PHP 5.1.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 10:01:30 2024 UTC