Commit graph

4 commits

Author SHA1 Message Date
Ralf Schlatterbeck 743245e230 Add 'x' prefix to time functions
.. to avoid name-clashes with (some) libraries. This now also should
make it work for the 'native' target (untested).
2016-03-29 17:48:59 +02:00
Ralf Schlatterbeck 0068611b4d Implement localtime
Now we manage a timezone and daylight-savings aware version of
localtime. We parse UNIX timezone strings. The default (active after the
first call to localtime or localtime_r) is CET/CEST, the timezone of
Europe/Vienna. The wallclock-time osd-example demonstrates how to set a
different timezone via the timezone resource.

Note: After startup no timezone is set. So in this state querying the
timezone resource will return an empty string. After first call to
localtime (if not timezone has been set via the timezone resource) a
query to timezone will return the default timezone string for CET/CEST.

The string returned by the localtime and utc timezones now also includes
the timezone name.

New fields tm_gmtoff and tm_zone were added to the tm structure. These
are available in BSD systems and when setting special compiler
definitions on Linux.

Note: the timezone offset information in the tm structure (tm_gmtoff)
as well as in the tz structure returned by gettimeofday (tz_minuteswest)
may be wrong sign, this code is largely untested.
2016-02-18 09:55:07 +01:00
Ralf Schlatterbeck 4f20df042f Fix leap year computation 2014-11-19 13:53:01 +01:00
Ralf Schlatterbeck b4fb8c3f52 Add wallclock time handling
New application and new example.
We use the built-in timer routines and add an offset to get the
wallclock time. The offset can be set by time-changing routines
(currently only settimeofday).
We also maintain an offset for timezone handling but this isn't
currently fully implemented.
2014-11-19 13:43:45 +01:00