Age | Commit message (Collapse) | Author |
|
|
|
It is nicer to predefine patterns using configure time check instead of
using casts everywhere.
Since we do not need to use any flags, include "%" in the format instead
of excluding it like PRI* macros.
|
|
|
|
|
|
This way, timedatectl can be run over the network and determine all
properties correctly from the server rather than the client.
|
|
Also, always show us timestamps in verbose mode.
https://bugzilla.redhat.com/show_bug.cgi?id=991678
|
|
I'm assuming that it's fine if a _const_ or _pure_ function
calls assert. It is assumed that the assert won't trigger,
and even if it does, it can only trigger on the first call
with a given set of parameters, and we don't care if the
compiler moves the order of calls.
|
|
Instead of outputting "5h 55s 50ms 3us" we'll now output "5h
55.050003s". Also, while outputting the accuracy is configurable.
Basically we now try use "dot notation" for all time values > 1min. For
>= 1s we use 's' as unit, otherwise for >= 1ms we use 'ms' as unit, and
finally 'us'.
This should give reasonably values in most cases.
|
|
We can now parse "0.5s" as the same as "500ms". In fact, we can parse
"3.45years" correctly, too, and any other unit and fraction length.
|
|
Internally we store all time values in usec_t, however parse_usec()
actually was used mostly to parse values in seconds (unless explicit
units were specified to define a different unit). Hence, be clear about
this and name the function about what we pass into it, not what we get
out of it.
|
|
|
|
$ LANG=el_GR.UTF-8 ./timedatectl
Local time: Σαβ 2012-11-24 14:53:05 CET
Universal time: Σαβ 2012-11-24 13:53:05 UTC
RTC time: Σαβ 2012-11-24 13:53:04
Timezone: Europe/Berlin (CET, +0100)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
DST active: no
Last DST change: DST ended at
Κυρ 2012-10-28 02:59:59 CEST
Κυρ 2012-10-28 02:00:00 CET
Next DST change: DST begins (the clock jumps one hour forward) at
Κυρ 2013-03-31 01:59:59 CET
Κυρ 2013-03-31 03:00:00 CEST
https://bugs.freedesktop.org/show_bug.cgi?id=57470
|
|
|
|
because that describes much better what it does
|
|
|