fix: correctly initialize offset

This commit is contained in:
ToruNiina
2019-06-18 21:27:16 +09:00
parent 569341a514
commit adcd75e017

View File

@@ -450,13 +450,13 @@ struct offset_datetime
: date(ld.date), time(ld.time), offset(get_local_offset()) : date(ld.date), time(ld.time), offset(get_local_offset())
{} {}
explicit offset_datetime(const std::chrono::system_clock::time_point& tp) explicit offset_datetime(const std::chrono::system_clock::time_point& tp)
: offset_datetime(local_datetime(tp)) : offset_datetime(local_datetime(tp)), offset(get_local_offset())
{} {}
explicit offset_datetime(const std::time_t& t) explicit offset_datetime(const std::time_t& t)
: offset_datetime(local_datetime(t)) : offset_datetime(local_datetime(t)), offset(get_local_offset())
{} {}
explicit offset_datetime(const std::tm& t) explicit offset_datetime(const std::tm& t)
: offset_datetime(local_datetime(t)) : offset_datetime(local_datetime(t)), offset(get_local_offset())
{} {}
operator std::chrono::system_clock::time_point() const operator std::chrono::system_clock::time_point() const