time/ISO8601: support time zone offset

This commit is contained in:
Max Kellermann
2019-08-19 22:38:06 +02:00
parent 26e0e1d25a
commit 2c35ea92bd
2 changed files with 59 additions and 0 deletions

View File

@@ -57,6 +57,12 @@ static constexpr struct {
/* without time zone */
{ "2019-02-04T16:46:41", 1549298801, std::chrono::seconds(1) },
/* with time zone */
{ "2019-02-04T16:46:41+02", 1549291601, std::chrono::seconds(1) },
{ "2019-02-04T16:46:41+0200", 1549291601, std::chrono::seconds(1) },
{ "2019-02-04T16:46:41+02:00", 1549291601, std::chrono::seconds(1) },
{ "2019-02-04T16:46:41-0200", 1549306001, std::chrono::seconds(1) },
};
TEST(ISO8601, Parse)