Age | Commit message (Collapse) | Author |
|
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
|
|
|