[systemd-devel] [Question] timezones in timers

Ivan Kurnosov zerkms at zerkms.ru
Wed Sep 6 20:12:33 UTC 2017


I'm doing it with the libc and doing it out of the process:

https://github.com/zerkms/systemd/blob/d09815ef6df4705e06bd0b3a276c4cbd8630859f/src/basic/calendarspec.c#L902

I believe parsing is portable standard C with libc and time conversion will
be very similar to that.

On 7 September 2017 at 01:25, Lennart Poettering <lennart at poettering.net>
wrote:

> On Mi, 06.09.17 13:18, Mantas Mikulėnas (grawity at gmail.com) wrote:
>
> > On Wed, Sep 6, 2017 at 12:58 PM, Ivan Kurnosov <zerkms at zerkms.ru> wrote:
> >
> > > I've started working on it (as a crazy experiment for myself primarily)
> > >
> > > At the moment I added support for timezones (IANA) to the
> `CalendarSpec`,
> > > the parser and the formatter.
> > >
> > > https://github.com/zerkms/systemd/commit/367325ae7a2c4df2c05
> > > 13e8bb8e9925aaf24feef
> > >
> >
> > systemd actually used to have code for parsing *tzdata files* (and
> showing
> > DST information in timedatectl); you might want to find that in Git.
>
> While it did parse that I don't think we should go that route
> here. When converting local time into unix time and back we really
> should let the libc deal with that, and not replicate that. it's not
> pretty to do this in libc, as there's no way to do time calculation in
> a non-default timezone except by manipulating env vars, but it's
> doable, as long as we do this out-of-process...
>
> Lennart
>
> --
> Lennart Poettering, Red Hat
>



-- 
With best regards, Ivan Kurnosov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20170907/3be42185/attachment.html>


More information about the systemd-devel mailing list