Page 1 of 1

Full Date and Time of a given localization

Posted: Tue Jul 17, 2007 10:56 am
by Germaris
Hi there !

I wish to display in my Flash File (don't worry about Flash, I know how to handle PHP results and send them to Flash !) which is read all throughout the world, the Full Date and Time of my Home.

My Server is in California, I am living in Quebec (three hours of difference) and my File could be read by friends in Japan or Indi or South Africa.
Displaying the Date and Time of my Home will say to my friends, for example : "Don't phone me, I'm sleeping" !!! He he he...

I thank you very much in advance for any advice, link, or active help !!!

Posted: Tue Jul 17, 2007 11:35 am
by Paw
Hi there,

that sounds like a case for time arithmetics. You can use the PHP function

Code: Select all

time()
for that, which returns the number of seconds since the "Unix epoch", and add +/- 10,800 to it (depending on if Quebec's time is 3 hours behind or advanced to California's).
The result can be put into the

Code: Select all

date()
function to create a nicely formatted date-time string.

Posted: Tue Jul 17, 2007 12:40 pm
by Germaris
This sounds good to me and seems to be an elegant solution...
I'll give it a try and keep you informed.

Many thanks !