summaryrefslogtreecommitdiff
path: root/src/shared/time-util.h
AgeCommit message (Collapse)Author
2013-04-04util: make time formatting a bit smarterLennart Poettering
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-03time: add suppot for fractional time specificationsLennart Poettering
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-03util: rename parse_usec() to parse_sec() sinds the default unit is secondsLennart Poettering
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-01-08core: properly initialize kernel timestampLennart Poettering
2012-11-24shared: FORMAT_TIMESTAMP_MAX -- include space for unicode weekdaysKay Sievers
$ 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-23time-util: also rename FORMAT_TIMESTAMP_PRETTY → _MAXLennart Poettering
2012-11-23util: rename format_timestamp_pretty() to format_timestamp_relative() ↵Lennart Poettering
because that describes much better what it does
2012-11-23util: split off time related calls from util.[ch] into time-util.[ch]Lennart Poettering