Search in the blog

вівторок, 20 квітня 2010 р.

Time convertions with daylight saving

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.

Немає коментарів:

Дописати коментар