How to convert server time to local time?
Posted
by Lost_in_code
on Stack Overflow
See other posts from Stack Overflow
or by Lost_in_code
Published on 2010-04-26T10:33:03Z
Indexed on
2010/04/26
10:43 UTC
Read the original article
Hit count: 155
php
My php file is hosted in some other part of the world. The date()
and time()
functions returns the date/time on the server. How do I convert that date so that it's the same as my local date/time?
The date on the server is 10 hours behind my local time. I could just hard code and substract this from the server time. But what is the proper way of going about this so that no value has to be hardcoded?
© Stack Overflow or respective owner