Commit Graph

45 Commits

Author SHA1 Message Date
5acf422f71 Add useful operators to DateTimeExpression
* Add serialization back to string, useful for implementing
  `TagValue::toString()`
* Add equality comparition
2022-08-13 14:10:40 +02:00
4911d16129 Add useful shorthands to DateTimeParts 2022-08-13 14:08:46 +02:00
3a06641bb9 Improve docs for DateTimeExpression 2022-08-13 14:07:57 +02:00
5fe03c23a2 Rename DateTimeParts::Millisecond to …::SubSecond
We're currently just tracking whether the second has a fraction so this is
more fitting.
2022-08-13 14:07:37 +02:00
f20d596785 Add DateTimeExpression to keep track of parsed timestamp parts
The existing timestamp parsers already internally keep track what parts
have been parsed via an index variable. This change exposes this
information as it can sometimes be useful to know what parts were actually
present in the timestamp.
2022-08-12 20:45:06 +02:00
77c353fb6c Add TickType and integer overloads to chrono utilities 2022-02-15 23:01:25 +01:00
b3ebe5ce38 Fix typos found via codespell --skip .git -w 2021-07-03 19:07:49 +02:00
8c033ca243 Fix warnings 2021-03-20 21:56:45 +01:00
32780ed6a6 Support formatting ISO timestamps via DateTime::toString() with option to omit defaults
Omitting components are also allowed when parsing ISO timestamps so it makes sense to
have something similar in the other direction as well.

Note that the idea comes from ID3v2.4.0 which stores timestamps in a subset of ISO 8601
similarily to what this library supports and it allows to omit default components as
well.
2020-04-26 21:38:02 +02:00
73470d0b65 Fix DateTime::fromDateAndTime() for the day 0001-01-01 2020-04-24 21:55:45 +02:00
34170b83f1 Apply clang-format 2020-04-13 01:10:33 +02:00
4b67736adf Add DateTime::toIsoStringWithCustomDelimiters() 2020-04-11 21:51:52 +02:00
085ec2feca Improve DateTime
* Improve documentation about time zone handling
* Add DateTime::toTimeStamp()
* Add experimental DateTime::fromChronoTimePoint()
  and DateTime::fromChronoTimePointGmt()
2019-11-17 22:30:51 +01:00
5c098df8d7 Fill last gaps in class list documentation 2019-09-04 18:54:48 +02:00
0feb7d667e Add inline/constexpr to more functions in chrono lib 2019-08-19 19:09:19 +02:00
b48b2f5c06 Have everything in one top-level namespace 2019-06-10 21:56:46 +02:00
9a50d2b8df Remove types 2019-04-13 20:33:39 +02:00
8b919250e3 chrono utils: Make public constants signed 2019-04-13 20:33:39 +02:00
7b01938ece Add {TimeSpan,DateTime}::ticks() for easier read/write 2018-06-23 14:32:46 +02:00
400e73005a Fix use of std::time 2018-01-28 18:03:58 +01:00
a89f6f9ce4 Improve documentation of chrono library 2017-12-03 01:45:11 +01:00
d7185fc1bc Improve documentation 2017-11-29 19:11:01 +01:00
e52fd5a4af Apply tidy after updating to clang-format 5.0.0
The behavior of clang-format slightly changed in Clang 5.0.0:
http://releases.llvm.org/5.0.0/tools/clang/docs/ReleaseNotes.html#clang-format
2017-09-17 21:45:23 +02:00
357ede4ee7 chrono utils: Improve handling micro- and nanoseconds
DateTime and TimeSpan have an accuracy of 100 nanoseconds.

This commit ensures this is also handled in toString() and
fromString() methods and adds relevant convenience methods.
2017-08-31 02:17:05 +02:00
b69d4a8b65 Disable DateTime::exactGmtNow() under MacOS
`clock_gettime(CLOCK_REALTIME, &t);` does not seem to
be available under MacOS
2017-07-29 00:32:19 +02:00
3bc9a7b07a Fix handling negative time spans 2017-06-25 16:00:11 +02:00
59e20b1043 Apply clang-format 2017-05-01 03:13:11 +02:00
c728f0ffe0 Add hash functions for chrono objects 2017-05-01 02:54:06 +02:00
452954dc1f Add DateTime::exactGmtNow()
* Provides more precise wall-clock time
* Only available under UNIX so far
2017-04-19 21:48:23 +02:00
31be0c24ea Add DateTime::fromIsoString{Gmt,Local} 2016-09-01 15:42:25 +02:00
12588c6928 Improve chrono utils
- Support parsing/generating ISO time stamp with
  time zone delta
- Fix minor bugs
- Improve tests
2016-08-30 19:59:04 +02:00
d6b08b8ed9 Fix decoration for static builds
- Also add improvemnts a few other things in the build system
2016-08-29 15:35:48 +02:00
db7b02b1db Make header guards more unique and consistent 2016-06-11 19:09:14 +02:00
76e422a7ce Make DateTime::now() and DateTime::gmtNow() inline 2016-05-23 00:04:06 +02:00
2e6a8dc6a8 added DateTime::gmtNow() 2016-02-15 20:29:52 +01:00
df9c0573bf preserve ABI 2016-01-29 01:13:11 +01:00
3c9f95059e added DateTime::fromTimeStampGmt() 2016-01-27 00:14:20 +01:00
a8f7644350 minor adjustments 2016-01-18 23:41:30 +01:00
9f4d1daacf fixed DateTime::now() 2015-09-22 22:52:43 +02:00
f3ee822cc6 make constructor explicit 2015-09-11 22:01:26 +02:00
4d6bf67188 fixed includes 2015-09-06 20:19:09 +02:00
603dbf823a fixed includes 2015-09-06 15:30:16 +02:00
8c09772802 added new method to construct DateTime instance from timestamp 2015-06-21 21:41:56 +02:00
6cd3315910 small adjustments 2015-05-17 17:18:07 +02:00
24ba96a17f First commit 2015-04-22 18:36:40 +02:00