4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 Changing GMT to BST
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
billdavies
Senior WebHelper
Senior WebHelper


Joined: 22 Jan 2002
Posts: 107
Location: UK

PostPosted: Sun May 19, 2002 5:51 pm (15 years, 7 months ago) Reply with QuoteBack to Top

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
OfflineView User's ProfileFind all posts by billdaviesSend Personal MessageVisit Poster's WebsiteMSN Messenger
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Sun May 19, 2002 6:01 pm (15 years, 7 months ago) Reply with QuoteBack to Top

Try this:

Code:
$time=mktime();
$bst_time=gmdate("H i s M d Y",$time+3600);
echo $bst_time;

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
Darren
Team Member



Joined: 05 Feb 2002
Posts: 549
Location: London

PostPosted: Sun May 19, 2002 6:07 pm (15 years, 7 months ago) Reply with QuoteBack to Top

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?
OfflineView User's ProfileFind all posts by DarrenSend Personal MessageVisit Poster's Website
Darren
Team Member



Joined: 05 Feb 2002
Posts: 549
Location: London

PostPosted: Sun May 19, 2002 6:07 pm (15 years, 7 months ago) Reply with QuoteBack to Top

beat me to it Daniel! and much simpler Laughing
OfflineView User's ProfileFind all posts by DarrenSend Personal MessageVisit Poster's Website
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




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.064281 seconds :: 17 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme