That’s basically it, I need the server local time instead of GMT, so I need the offset (number of seconds) to add to what time() returns.
I also need this to work in any version of PHP 5, since I don’t know if I’ll have the latest version available.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could just use
date_default_timezone_set('...');at the top of your page. (Where...is your time zone)This will make all
date()usage be set on that time zone.For instance if you use
date("H:i d-M-Y")it will show the time showed by Windows on your computer; if you had set that time zone to your local time zone.See PHP Manual for reference.