Doc #67870 [NEW]: jdtounix() claims localtime, but that's not true

From: Date: Wed, 20 Aug 2014 09:14:57 +0000
Subject: Doc #67870 [NEW]: jdtounix() claims localtime, but that's not true
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-11435@lists.php.net to get a copy of this message
From: asphp at dsgml dot com Operating system: PHP version: Irrelevant Package: Documentation problem Bug Type: Documentation Problem Bug description:jdtounix() claims localtime, but that's not true Description: ------------ --- From manual page: http://www.php.net/function.jdtounix --- It says: "The time returned is localtime (and not GMT)." But this is not true. Part of the problem is bug #13187 which claims: "so jdtounix returns localtime while mysql unix_timestamp returns GMT" Which is not true! It's actually exactly the opposite! MySQL returns localtime, and PHP returns GMT. You can even look at the source code: (uday * 24 * 3600) No adjustment whatsoever for timezone. Test script: --------------- <? date_default_timezone_set('America/New_York'); echo jdtounix(2440588) , "\n" . jdtounix(2440589); Expected result: ---------------- If it was local time then I would not get: 0 86400 But I do. Those times are exactly midnight UTC. -- Edit bug report at https://bugs.php.net/bug.php?id=67870&edit=1 --

« previous php.doc.bugs (#11435) next »