Browse DevX
Sign up for e-mail newsletters from DevX


The Art of Daylight Savings Time

Confused by the recent changes in the Daylight Saving Time scheme? Learn about the ramifications of these changes and find out how to access your system's Daylight Savings Time information programmatically.

A month ago, I discussed the strfmt() function. A timely announcement from Microsoft has inspired me to write a column about a related topic, namely accessing the system's Daylight Saving Time information programmatically. This article shows how to detect whether DST is in effect in the current local time zone.

How can you detect whether DST is in effect in your current local time zone? How do you detect the difference between the local standard time and the local alternate time?

Use the _tzset(), _daylight, _timezone, and _tzname facilities of the standard <ctime> library.

Thanks for your registration, follow us on our social networks to keep up-to-date