Page 1 of 1

current time for the desired country

Posted: Wed May 03, 2006 2:45 am
by pleigh
hi, i am looking for a function the will get the time for a specific country where the the time that will reflect in the users all over the world will view the time where the hosting server will be...i hope you understand...for example, if the server is in india, and i am a user from italy, i will be able to view the indian time in my computer... :)

by the way, i also want to get the weather for that country as well... :wink:

Posted: Wed May 03, 2006 9:13 am
by hawleyjr
You'll have to gather the data and put it into a table.

I'd recomend taking a look at The World Factbook They also have a downloadable one I belive...

Posted: Wed May 03, 2006 9:17 am
by someberry
Sounds like you may need putenv(). Didn't really understand you though.

Posted: Wed May 03, 2006 9:37 am
by feyd
Getting the time set on the server is really simple: time(). Whether that is accurate to where the server is located is up to its administrator, however if you want to place the server in a specific location gmmktime() is more useful to get a standardized time which can be offset however you wish from GMT. Depending on server settings, it may not take daylight savings into account. If this is the case, you'll have to build the logic for when to adjust the time further based on your regional daylight rules.

Posted: Wed May 03, 2006 10:22 am
by pickle
My country (Canada) has 6 timezones - you might need to get more granular than country.