php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15815 date() shifting time
Submitted: 2002-03-01 12:05 UTC Modified: 2002-07-14 18:51 UTC
From: geoffrey at poulet dot org Assigned:
Status: Closed Package: Date/time related
PHP Version: 4.0.6 OS: FreeBSD 4.2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: geoffrey at poulet dot org
New email:
PHP Version: OS:

 

 [2002-03-01 12:05 UTC] geoffrey at poulet dot org
Shifting time.
Sometimes the function date() return a bad time.

Below some examples:

server time= from date in shell
response time = from function date() in php.

Server time: 15:41:16 
response time:00:41:16 (21 february) 

Server time: 16:12:16 
response time:01:12:16 (21 february) 

Server time: 16:25:16 
response time:01:25:16 (21 february) 

Server time: 17:04:16 
response time:02:04:16 (21 february) 

Server time: 17:56:16 
response time:02:56:16 (21 february) 

Server time: 18:57:16 
response time:03:57:16 (21 february) 


More information:
System FreeBSD make2.plesk.ru 4.2-RELEASE FreeBSD 4.2-RELEASE #0: Mon Nov 20 13:02:55 GMT 2000     jkh@bento.FreeBSD.org:/usr/src/sys/compile/GENERIC  i386 
Build Date Oct 11 2001 
Configure Command  './configure' '--with-apxs=apxs' '--prefix=/usr/home/kap/plesk/2.0/apache/../release/usr/local/psa/apache' 'i386--freebsd4.2' '--with-system-regex' '--with-config-file-path=/usr/local/psa/apache/conf' '--disable-debug' '--disable-pear' '--enable-sockets' '--enable-track-vars' '--without-gd' '--with-mysql=/usr/home/kap/plesk/2.0/apache/../release/dist/usr/local/psa/mysql' '--with-iodbc=/usr/home/kap/plesk/2.0/apache/../release/lib/libiodbc' '--with-imap=/usr/home/kap/plesk/2.0/apache/../release/lib/imap-cclient' 
Server API Apache 
Virtual Directory Support disabled 
Configuration File (php.ini) Path /usr/local/psa/apache/conf/php.ini 
ZEND_DEBUG disabled 
Thread Safety disabled 


Geoffrey.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-03-01 12:10 UTC] sander@php.net
What is your timezone offset? date() doesn't use GMT if you're in another timezone. Maybe your shell does use GMT (mine doesn't, but I'm on linux...)
 [2002-03-01 12:27 UTC] geoffrey at poulet dot org
GMT, the server is in england.

The date() return good time except for some minutes per 
day.
There is no logic, sometimes at 08:45:16, sometimes at 
14:13:08 ...
when the date() bug, 8 hours is added.
This is crazy.
 [2002-07-03 19:12 UTC] eru@php.net
Could you please provide a minimal script, that reproduces your problem? Another issue might be the slightly outdated version of PHP, could you retry it with a current 4.2.1?

Please switch to "Open" again, when you're giving feedback.

Thanks for your help.

 [2002-07-04 04:30 UTC] geoffrey at poulet dot org
Ok some more information. 
php version have been upgraded to 4.1 (Plesk 2.5.1).
The problem is still there .... i think less often.

The script ... just use date() and echo the comlplete date.
HIT F5.

OR
SHELLSCRIPT:
serverdate=`date +%Y%m%d%H%M`
/usr/local/bin/lynx -dump 
http://www.YOURSERVER.com/shiftbug.php?serverdate=$serverda
te
(run it in the cron)

SHITBUG.PHP
<?php
sleep (16);
$time = time();
$datephp = date("Y-m-d H:i:s",$time);

mail ("bug@ebid.be","$datephp-$serverdate","From: 
mail@azazaz.com\n".

                        "Content-type: text/plain\n" );
?>
Or something like that. It takes time in shell (which is 
correct) and GET it to the php page, which send the current 
date in shell and in php by email ...

Good chance ... I forgot to find a solution ... i'll move 
to a new server soon :(

Geoffrey.
 [2002-07-13 14:14 UTC] derick@php.net
Is this still an issue with PHP 4.2.1?

Derick
 [2002-07-13 14:47 UTC] geoffrey at poulet dot org
I don't know ... this is not my server so I cannot change the PHP version.

Geoffrey.
 [2002-07-13 22:45 UTC] sniper@php.net
Please provide a self contained and complete script
which CLEARLY shows what the problem is.


 [2002-07-14 05:29 UTC] geoffrey at poulet dot org
The time shifting ... it cannot be less clear.
When I use the time() function in php. Sometimes, the time switch to 8 hours more.

There is no special script. Just echo date&time and HIT F5.
The happen at least one time per hour.

Take a look there: 
http://www.eBid.be
This is an auction website, so this is why I found this problem. I need to use the date() function all the time, to post auctions, to bid, to close auctions ...
 [2002-07-14 18:51 UTC] sniper@php.net
I can not reproduce this with PHP 4.2.1 or 4.3.0-dev.
Please update your PHP.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 10:01:28 2024 UTC