So do I:
     echo "<br>Mkt: " . mktime(0,0,0,1,1,1970);
     echo "<br>GMT: " . gmmktime(0,0,0,1,1,1970);
produces
     Mkt: 0
     GMT: -3600
BTW I'm running PHP under WinNT4.0

mktime -- Get UNIX timestamp for a date 
(http://www.php.net/manual/en/function.mktime.php)
Returns the Unix timestamp corresponding to the arguments given. This timestamp is a 
long integer containing the number
of seconds between the Unix Epoch (January 1 1970) and the time specified.

gmmktime -- Get UNIX timestamp for a GMT date 
(http://www.php.net/manual/en/function.gmmktime.php)
Identical to mktime() except the passed parameters represents a GMT date.

Given that 1Jan1970 was not in Summer time, I would expect that a localised British 
(etc) machine would deliver the same
answer from both functions. So there's some logic here that I don't follow either. 
Perhaps someone of greater mind...?

I will send you a sandbox routine I made up when I was playing with times and dates, 
and trying to get a handle on
working in GMT to settle (WORLD wide web) relative time-ing issues. It's not flash, 
but happily dumps out various
date/time function results and illustrates the various argument/format choices (I'm 
not sure of list rules, so I'll send
it privately - if anyone else wants it, please email me directly. HTH). Run it today - 
you'll get the "rd" after 23rd,
and this week - to get a GMT/BST difference!

Here's a sample run:
----------
UNIX microtime=0.26452800 1003852812~

UNIX epoch timestamp=1003852812~
Alternative method=1003852812~

Local/RFC=Tue, 23 Oct 2001 17:00:12 +0100~
Local/Times: hh/HH:mm:ss=05/17:00:12~
Local/Days: d, dd, ddd, day, Su0Sa6=23,23,Tue,Tuesday,2~
Local/Months: long, mmm, mm=October,Oct,10~
Local/Years: yyyy, yy=2001,01~
Local/Booleans: DST,Lyr=1,0~
Local/Misc: AM/PM, am/pm, st/nd, days/mmm, day/yr=PM,pm,rd,31,295~
Local/TimeZones: diffGMT, PC-TZ, offset=+0100,,3600~

Date to Timestamp=1003852812~

GMT/RFC=Tue, 23 Oct 2001 16:00:12 +0000~
GMT/Times: hh/HH:mm:ss=04/16:00:12~
GMT/Days: d, dd, ddd, day, Su0Sa6=23,23,Tue,Tuesday,2~
GMT/Months: long, mmm, mm=October,Oct,10~
GMT/Years: yyyy, yy=2001,01~
GMT/Booleans: DST,Lyr=0,0~
GMT/Misc: AM/PM, am/pm, st/nd, days/mmm, day/yr=PM,pm,rd,31,295~
GMT/TimeZones: diffGMT, PC-TZ, offset=+0000,,0~

Date to GMT Timestamp=1003849212~

UNIX microtime=0.00617600 1003852813~
----------

Regards,
=dn



> Oh dear, I still get -3600 when I do
>
> echo gmmktime(0,0,0,1,1,1970);
>
> Why?
>
> James
>
> -----Original Message-----
> From: Fairbairn,J,James,IVLH4 C
> Sent: 23 October 2001 13:57
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP] mktime() problem
>
>
> Thanks, I'll use gmmktime() from now on!
>
> James
>
> -----Original Message-----
> From: DL Neil [mailto:[EMAIL PROTECTED]]
> Sent: 23 October 2001 13:54
> To: Fairbairn,J,James,IVLH4 C; php-general
> Subject: Re: [PHP] mktime() problem
>
>
> > I'm running 4.0.6 on a Solaris 8 box. The output given by
> > echo mktime(0,0,0,1,1,1970);
> > is 3600.
> >
> > Shouldn't it be 0? My box's locale is set to the UK defaults, so as I
> write
> > this we are in daylight savings (GMT+1). Would this make a difference? (I
> > have already tried
> > echo mktime(0,0,0,1,1,1970,0);
> > to force non-daylight-savings, but I still get 3600.) Am I doing something
> > wrong, or have I found a bug?
>
>
> James,
> Had to worry about this too!
> Try comparing gmmktime() and mktime().
> Regards,
> =dn
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to