php - How to get timezone hour offset and account for DST with PEAR::Date? -


According to the date of the summer, I am trying to get offset hours from UTC, my system time is set to US / Los_Agelas is.

I have the following:

  need_once ("Date.php"); $ Date TZ = new dateTimon ('America / Los_Anjals'); Echo $ dateTZ-> GetOffset (new date ('2009-07-01 12:00:00')) / 1000/60/60;  

Print this '-8'; It should not show '-7'?

$ dateTZ-> GetOffset (new date ()) / 1000/60/60;

Also print '-8'

What am I doing wrong?

Do you help? Claim to include Daylight Savings Offset.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -