|
Author |
Message |
billdavies
Senior WebHelper
Joined: 22 Jan 2002
Posts: 107
Location: UK
|
Posted:
Sun May 19, 2002 5:51 pm (21 years, 11 months ago) |
|
Hi,
If you were using this PHP code
<html>
<body>
<?php echo gmdate("H i s M d Y");
?>
</body>
</html>
How would you change it so that it displayed the time in BST. I know there is a difference but don't know how to change the code!
Thanks
Bill |
|
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Sun May 19, 2002 6:01 pm (21 years, 11 months ago) |
|
Try this:
Code: | $time=mktime();
$bst_time=gmdate("H i s M d Y",$time+3600);
echo $bst_time; |
|
________________________________
|
|
|
|
Darren
Team Member
Joined: 05 Feb 2002
Posts: 549
Location: London
|
Posted:
Sun May 19, 2002 6:07 pm (21 years, 11 months ago) |
|
I have an example in a book that is used for finding the time for different locales.
It uses the gmdate() function to get the individual bits of info, e.g.
Code: | $day = gmdate("d");
$month= gmdate("m");
etc... |
For the hour they add an offset:
Code: | $hour= gmdate("H") + $offset; |
They then use this to return the adjusted date/time:
Code: | $time = getdate(mktime($hour, $minutes, $seconds, $month, $day, $year)); |
Not sure if thats any use to you anyone know a quicker way? |
|
|
|
|
Darren
Team Member
Joined: 05 Feb 2002
Posts: 549
Location: London
|
Posted:
Sun May 19, 2002 6:07 pm (21 years, 11 months ago) |
|
beat me to it Daniel! and much simpler |
|
|
|
|
|
|
You cannot post new topics in this forum. You cannot reply to topics in this forum. You cannot edit your posts in this forum. You cannot delete your posts in this forum. You cannot vote in polls in this forum.
|
Page generation time: 0.143213 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0
© 2001, 2002 phpBB Group :: Based on an FI Theme
| |