Ask a Question related to PHP Development, Design and Development.
-
sniper@php.net #1
#24603 [Opn->Bgs]: all timefunctions don't give back correct time
ID: 24603
Updated by: [email]sniper@php.net[/email]
Reported By: akorthaus at web dot de
-Status: Open
+Status: Bogus
Bug Type: Date/time related
Operating System: RedHat-Linux 7.3, kernel 2.4.20
PHP Version: 4.3.2
New Comment:
We are happy to tell you that you just discovered Daylight Savings
Time. For more information see:
[url]http://webexhibits.org/daylightsaving/b.html[/url]
Instead of using mktime/date consider using gmmktime and gmdate which
do
not suffer from DST.
Borked system. Works fine here:
18:49:44 EEST
15:49:44 GMT
Fri Jul 11 18:49:44 EEST 2003
script:
<?php
echo date("H:i:s T"), "\n";
echo gmdate("H:i:s T"),"\n";
echo exec('date'), "\n";
?>
Remember the DST...
Previous Comments:
------------------------------------------------------------------------
[2003-07-11 08:01:18] akorthaus at web dot de
Description:
------------
Hi!
Now I'm trying to solve this problem for more then 10 houres, nad
nobody seems to know what is going wrong here. If I try this:
<?php
echo date("H:i:s")."\n";
echo gmdate("H:i:s");
?>
That displays:
12:36:36
11:36:36
What I would expect would be the same like date in shell:
# date
Fri Jul 11 13:37:39 CEST 2003
the correspondent Apache access-log:
[11/Jul/2003:12:36:36 +0100]
# /sbin/hwclock
returns
Fri 11 Jul 2003 13:36:42 PM CEST 0.707042 seconds
and it could not be set by
# /sbin/hwclock --systohc --utc
but I think thats not important
# ls -l /etc/localtime
lrwxrwxrwx 1 root root 33 Jul 11 09:33 /etc/localtime
-> /usr/share/zoneinfo/Europe/Berlin
which is what I want(my timezone). It's GMT + 1. PHP _has_ these
difference of one hour between time() and gmtime(), but both are an
extra hour too late.
I also restartet Apache, I tried to change /etc/sysconfig/clock, which
is now:
# cat /etc/sysconfig/clock
ZONE="Europe/Berlin"
UTC=true
ARC=false
But PHP did not take care about changes in it, PHP also did not care
about changing my timezone, this 1 hour too late stays.
also ntpdate did not help, the time was changed about 3 seconds.
Im Using RedHat Linux 7.3 min.-Installation
I compiled Apache 1.3.27 with PHP 4.3.2 as static module.
My PHP-./configure:
../configure --with-apache=../apache_1.3.27 --with-mysql --with-gd
--with-jpeg-dir=/usr --with-png-dir=/usr --with-ttf --with-zlib
--enable-gd-native-ttf --enable-trans-sid --disable-cgi --enable-ftp
I'm using PHP-Accelerator.
I have asked a lot of people and searched for people with similar
problems, but I did not find any. So my last Idea is that it's a
PHP-Bug.
Reproduce code:
---------------
<?php
echo date("H:i:s")."\n";
echo gmdate("H:i:s");
?>
Expected result:
----------------
date: +-0 hours
gmdate -1 hour
Actual result:
--------------
date: -1 hour
gmdate -2 hours
------------------------------------------------------------------------
--
Edit this bug report at [url]http://bugs.php.net/?id=24603&edit=1[/url]
sniper@php.net Guest
-
FlashForm mess if user hits back button - Refresh a pageonly 1 time
hi Flash forms get messed up when user hits back button i want to bypass this by refreshing a page 1 time and only 1 time when it loads, how do i do... -
PATCH: correct time zone calc in date.rb
No-one responded to the message I posted about this a few weeks ago, but here's a patch to fix the timezone calculation in date.rb - without the... -
Voice-over plays back double time
hi there i created a project with background sound in channel 2 and voice-over clips in channel 1 i played the project on four separate... -
Plug In Filters to Give a Natural Incandescent Light Look or Correct for Flourescent
I am far from being a graphics person. But I really like the warm look of natural incandescent or candle light. Many times with the maybe 10,000... -
#24603 [Bgs]: all timefunctions don't give back correct time
ID: 24603 User updated by: akorthaus at web dot de Reported By: akorthaus at web dot de Status: Bogus Bug Type: ...



Reply With Quote

