diff options
| author | Carl Hetherington <cth@carlh.net> | 2022-12-01 21:47:21 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2022-12-13 21:57:52 +0100 |
| commit | 6fbba420657d893a5da770af20364af4d689d4b7 (patch) | |
| tree | b47daa7e95defec1cb7b13dcc2113a41a08e0afe | |
| parent | be9a270cdf3fe43126bc94e19aa06bb5a939aadf (diff) | |
Add new LocalTime constructor.
| -rw-r--r-- | src/local_time.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/local_time.h b/src/local_time.h index d2f4b2c5..58acc227 100644 --- a/src/local_time.h +++ b/src/local_time.h @@ -80,6 +80,15 @@ public: /** @param s A string of the form 2013-01-05T18:06:59[.123][+04:00] */ explicit LocalTime (std::string s); + LocalTime(int year, int month, int day, int hour, int minute, UTCOffset offset) + : _year(year) + , _month(month) + , _day(day) + , _hour(hour) + , _minute(minute) + , _offset(offset) + {} + /** @return A string of the form 2013-01-05T18:06:59+04:00 or 2013-01-05T18:06:59.123+04:00 */ std::string as_string (bool with_millisecond = false) const; |
