mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-12-16 03:08:52 +08:00
add ctor(local_datetime, time_offset) to offset_datetime
This commit is contained in:
@@ -361,26 +361,25 @@ operator<<(std::basic_ostream<charT, traits>& os, const local_datetime& dt)
|
|||||||
|
|
||||||
struct offset_datetime
|
struct offset_datetime
|
||||||
{
|
{
|
||||||
local_date date;
|
local_date date;
|
||||||
local_time time;
|
local_time time;
|
||||||
time_offset offset;
|
time_offset offset;
|
||||||
|
|
||||||
offset_datetime(local_date d, local_time t, time_offset o)
|
offset_datetime(local_date d, local_time t, time_offset o)
|
||||||
: date(d), time(t), offset(o)
|
: date(d), time(t), offset(o)
|
||||||
{}
|
{}
|
||||||
|
offset_datetime(const local_datetime& dt, time_offset o)
|
||||||
|
: date(dt.date), time(dt.time), offset(o)
|
||||||
|
{}
|
||||||
offset_datetime(const local_datetime& ld)
|
offset_datetime(const local_datetime& ld)
|
||||||
: date(ld.date), time(ld.time), offset(get_local_offset())
|
: date(ld.date), time(ld.time), offset(get_local_offset())
|
||||||
{}
|
{}
|
||||||
|
|
||||||
offset_datetime(const std::chrono::system_clock::time_point& tp)
|
offset_datetime(const std::chrono::system_clock::time_point& tp)
|
||||||
: offset_datetime(local_datetime(tp))
|
: offset_datetime(local_datetime(tp))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
offset_datetime(const std::time_t& t)
|
offset_datetime(const std::time_t& t)
|
||||||
: offset_datetime(local_datetime(t))
|
: offset_datetime(local_datetime(t))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
offset_datetime(const std::tm& t)
|
offset_datetime(const std::tm& t)
|
||||||
: offset_datetime(local_datetime(t))
|
: offset_datetime(local_datetime(t))
|
||||||
{}
|
{}
|
||||||
|
|||||||
Reference in New Issue
Block a user