Time convertions with daylight saving

20 April 2010

I’ve found how to convert time from UTC to local time with daylight saving correction:

  1. Use mktime() to create time from string(or some thing else)
  2. get time from gmtime() and localtime()
  3. calculate difference between time to get timezone offset (or use_get_timezone)
  4. use tm::tm_isdst to determine apply or not daylight saving
  5. use _get_daylight() to get value in hours of daylight correction.
Share on Facebook Share on Google Plus Share on LinkeIn

I'm in social networks

GitHub

LinkedIn

Google

Search:

Tags: