nxt_time_parse.c (611:323e11065f83) nxt_time_parse.c (2078:0996dd223cdd)
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#include <nxt_main.h>
8

--- 268 unchanged lines hidden (view full) ---

277
278 /*
279 * 719527 days were between March 1, 1 BCE and March 1, 1970,
280 * 31 and 28 days were in January and February 1970.
281 */
282 days = days - 719527 + 31 + 28;
283
284 s = (uint64_t) days * 86400
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#include <nxt_main.h>
8

--- 268 unchanged lines hidden (view full) ---

277
278 /*
279 * 719527 days were between March 1, 1 BCE and March 1, 1970,
280 * 31 and 28 days were in January and February 1970.
281 */
282 days = days - 719527 + 31 + 28;
283
284 s = (uint64_t) days * 86400
285 + (nxt_uint_t) hour * 3600
286 + (nxt_uint_t) min * 60
287 + (nxt_uint_t) sec;
285 + (nxt_uint_t) hour * 3600
286 + (nxt_uint_t) min * 60
287 + (nxt_uint_t) sec;
288
289#if (NXT_TIME_T_SIZE <= 4)
290
291 /* Y2038 */
292
293 if (nxt_slow_path(s > 0x7FFFFFFF)) {
294 return -1;
295 }

--- 194 unchanged lines hidden ---
288
289#if (NXT_TIME_T_SIZE <= 4)
290
291 /* Y2038 */
292
293 if (nxt_slow_path(s > 0x7FFFFFFF)) {
294 return -1;
295 }

--- 194 unchanged lines hidden ---