mirror of
https://github.com/HowardHinnant/date.git
synced 2024-12-27 08:31:03 +08:00
Do not use user defined literals for VS2013 compatibility.
This commit is contained in:
parent
e107bcdef2
commit
570a1e699c
12
tz.h
12
tz.h
@ -1150,7 +1150,7 @@ tai_clock::utc_to_tai(utc_time<Duration> t)
|
||||
using namespace std::chrono;
|
||||
using duration = typename std::common_type<Duration, seconds>::type;
|
||||
return tai_time<duration>{t.time_since_epoch()} +
|
||||
(sys_days{1970_y/jan/1} - sys_days{1958_y/jan/1} + seconds{10});
|
||||
(sys_days{year{1970}/jan/1} - sys_days{year{1958}/jan/1} + seconds{10});
|
||||
}
|
||||
|
||||
template <class Duration>
|
||||
@ -1160,7 +1160,7 @@ tai_clock::tai_to_utc(tai_time<Duration> t)
|
||||
using namespace std::chrono;
|
||||
using duration = typename std::common_type<Duration, seconds>::type;
|
||||
return utc_time<duration>{t.time_since_epoch()} -
|
||||
(sys_days{1970_y/jan/1} - sys_days{1958_y/jan/1} + seconds{10});
|
||||
(sys_days{year{1970}/jan/1} - sys_days{year{1958}/jan/1} + seconds{10});
|
||||
}
|
||||
|
||||
template <class Duration>
|
||||
@ -1194,7 +1194,7 @@ operator<<(std::basic_ostream<CharT, Traits>& os, const tai_time<Duration>& t)
|
||||
using namespace std::chrono;
|
||||
using duration = typename std::common_type<Duration, seconds>::type;
|
||||
auto tp = sys_time<duration>{t.time_since_epoch()} -
|
||||
(sys_days{1970_y/jan/1} - sys_days{1958_y/jan/1});
|
||||
(sys_days{year{1970}/jan/1} - sys_days{year{1958}/jan/1});
|
||||
return os << tp;
|
||||
}
|
||||
|
||||
@ -1235,7 +1235,7 @@ gps_clock::utc_to_gps(utc_time<Duration> t)
|
||||
using namespace std::chrono;
|
||||
using duration = typename std::common_type<Duration, seconds>::type;
|
||||
return gps_time<duration>{t.time_since_epoch()} -
|
||||
(sys_days{1980_y/jan/sun[1]} - sys_days{1970_y/jan/1} + seconds{9});
|
||||
(sys_days{year{1980}/jan/sun[1]} - sys_days{year{1970}/jan/1} + seconds{9});
|
||||
}
|
||||
|
||||
template <class Duration>
|
||||
@ -1245,7 +1245,7 @@ gps_clock::gps_to_utc(gps_time<Duration> t)
|
||||
using namespace std::chrono;
|
||||
using duration = typename std::common_type<Duration, seconds>::type;
|
||||
return utc_time<duration>{t.time_since_epoch()} +
|
||||
(sys_days{1980_y/jan/sun[1]} - sys_days{1970_y/jan/1} + seconds{9});
|
||||
(sys_days{year{1980}/jan/sun[1]} - sys_days{year{1970}/jan/1} + seconds{9});
|
||||
}
|
||||
|
||||
template <class Duration>
|
||||
@ -1279,7 +1279,7 @@ operator<<(std::basic_ostream<CharT, Traits>& os, const gps_time<Duration>& t)
|
||||
using namespace std::chrono;
|
||||
using duration = typename std::common_type<Duration, seconds>::type;
|
||||
auto tp = sys_time<duration>{t.time_since_epoch()} +
|
||||
(sys_days{1980_y/jan/sun[1]} - sys_days{1970_y/jan/1});
|
||||
(sys_days{year{1980}/jan/sun[1]} - sys_days{year{1970}/jan/1});
|
||||
return os << tp;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user