1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-04 13:51:24 +03:00
Commit Graph

8 Commits

Author SHA1 Message Date
Lennart Poettering
2fa4092c28 util: make time formatting a bit smarter
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.
2013-04-04 02:56:56 +02:00
Lennart Poettering
cb0dac0548 time: add suppot for fractional time specifications
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.
2013-04-03 23:00:08 +02:00
Lennart Poettering
7f602784de util: rename parse_usec() to parse_sec() sinds the default unit is seconds
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.
2013-04-03 20:12:57 +02:00
Lennart Poettering
cae0c5e042 core: properly initialize kernel timestamp 2013-01-08 01:27:39 +01:00
Kay Sievers
f0d7b0fcff shared: FORMAT_TIMESTAMP_MAX -- include space for unicode weekdays
$ 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
2012-11-24 14:55:35 +01:00
Lennart Poettering
9185c8e626 time-util: also rename FORMAT_TIMESTAMP_PRETTY → _MAX 2012-11-23 22:51:55 +01:00
Lennart Poettering
bbb8486e17 util: rename format_timestamp_pretty() to format_timestamp_relative() because that describes much better what it does 2012-11-23 22:12:59 +01:00
Lennart Poettering
9a98c7a156 util: split off time related calls from util.[ch] into time-util.[ch] 2012-11-23 22:07:24 +01:00