> -----Original Message-----
> From: Glenn [mailto:[EMAIL PROTECTED]
> Sent: 25 June 2003 14:58

[....]
 
> Here is what's weired.
> 
> I use these lines to get the specifics:
> $StartHour = substr("$StartTime", 0, 2);
> $StartMinute = substr("$StartTime", 3, 2);
> $EndHour = substr("$EndTime", 0, 2);
> $EndMinute = substr("$EndTime", 3, 2);
> list($SMonth, $SDay, $SYear) = split('/', $StartDate);
> list($EMonth, $EDay, $EYear) = split('/', $EndDate);
> 
> I then do this:
> $SUnixTime = mktime($StartHour, $StartMinute, 00, $SMonth, 
> $SDay, $SYear);
> 
> This is what's being sent to the mktime:
> (17,00,00,06,23,2003)
> 
> This is what it ouputs:
> 1056405600
> 
> Which is not technically correct.  That is the unix time stamp for the
> starting our in Zulu time (greenwich mean time) which is 
> currently 5 hours
> ahead of my timezone.
> 
> Can anyone tell me why mktime is automatically converting to 
> zulu time?

UNIX timestamps are *always* GMT -- it's the routines that process them that
do timezone (and DST) conversion.  To prove this, run the following on your
server:

<?php
   $timestamp = 1056405600;
   echo "GMT = ", gmdate("Y-m-d H:i:s"), "<br />\n";
   echo "local = ", date("Y-m-d H:i:s"), "<br />\n";
?>

Also see the manual page for gmdate() at http://www.php.net/gmdate which
shows a very similar script as its first example.

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to