32template <
typename TimeType>
35 TimeType
const*
const ptime
58 if (*ptime > 3 *
_DAY_SEC && *ptime < time_traits::max_time_t - 3 *
_DAY_SEC)
66 errno_t status0 = time_traits::gmtime_s(ptm, <ime);
75 errno_t const status1 = time_traits::gmtime_s(ptm, <ime);
89 errno_t const status0 = time_traits::gmtime_s(ptm, ptime);
93 TimeType ltime =
static_cast<TimeType
>(ptm->tm_sec);
106 ptm->tm_sec =
static_cast<int>(ltime % 60);
113 ltime =
static_cast<TimeType
>(ptm->tm_min) + ltime / 60;
114 ptm->tm_min =
static_cast<int>(ltime % 60);
121 ltime =
static_cast<TimeType
>(ptm->tm_hour) + ltime / 60;
122 ptm->tm_hour =
static_cast<int>(ltime % 24);
123 if (ptm->tm_hour < 0)
135 ptm->tm_wday = (ptm->tm_wday +
static_cast<int>(ltime)) % 7;
136 ptm->tm_mday +=
static_cast<int>(ltime);
137 ptm->tm_yday +=
static_cast<int>(ltime);
143 ptm->tm_wday = (ptm->tm_wday + 7 +
static_cast<int>(ltime)) % 7;
144 ptm->tm_mday +=
static_cast<int>(ltime);
145 if (ptm->tm_mday <= 0)
151 ptm->tm_yday = ptm->tm_yday +
static_cast<int>(ltime) + 365;
157 ptm->tm_yday +=
static_cast<int>(ltime);
186template <
typename TimeType>
205 return common_localtime(ptime);
210 return common_localtime(ptime);
int __cdecl _isindst(_In_ tm *_Time)
tm *__cdecl __getgmtimebuf()
result_buffer_count char *const _In_ int const _In_ bool const _In_ unsigned const _In_ STRFLT const _In_ bool const _Inout_ __crt_cached_ptd_host &ptd throw()
#define _VALIDATE_RETURN_ERRCODE(expr, errorcode)
#define _VALIDATE_RETURN_ERRCODE_NOEXC(expr, errorcode)
errno_t __cdecl _localtime32_s(tm *const ptm, __time32_t const *const ptime)
errno_t __cdecl _localtime64_s(tm *const ptm, __time64_t const *const ptime)
tm *__cdecl _localtime64(__time64_t const *const ptime)
static errno_t __cdecl common_localtime_s(tm *const ptm, TimeType const *const ptime)
tm *__cdecl _localtime32(__time32_t const *const ptime)
_CRTIMP errno_t __cdecl _get_daylight(_Out_ int *_Daylight)
_CRTIMP errno_t __cdecl _get_dstbias(_Out_ long *_Daylight_savings_bias)
_CRTIMP errno_t __cdecl _get_timezone(_Out_ long *_Timezone)