Fossil SCM
dropped back to a simpler timestamp generation mechanism. Thanks to Ge Weijers for the input.
Commit
147f4bfb62bfb948b6a63fb60ec7a9327690cc54
Parent
388c9888afe93db…
1 file changed
+8
-1
+8
-1
| --- src/json.c | ||
| +++ src/json.c | ||
| @@ -558,12 +558,19 @@ | ||
| 558 | 558 | SET("fossil"); |
| 559 | 559 | |
| 560 | 560 | {/* "timestamp" */ |
| 561 | 561 | cson_int_t jsTime; |
| 562 | 562 | #if 1 |
| 563 | + jsTime = (cson_int_t)time(0); | |
| 564 | +#elif 1 | |
| 563 | 565 | /* Ge Weijers has pointed out that time(0) commonly returns |
| 564 | - GMT, but is not required to by the standard. | |
| 566 | + UTC, but is not required to by The Standard. | |
| 567 | + | |
| 568 | + There is a mkfmtime() function in cgi.c but it requires | |
| 569 | + a (tm *), and i don't have that without calling gmtime() | |
| 570 | + or populating the tm myself (which is what i'm trying to | |
| 571 | + have done for me!). | |
| 565 | 572 | */ |
| 566 | 573 | time_t const t = (time_t)time(0); |
| 567 | 574 | struct tm gt = *gmtime(&t); |
| 568 | 575 | gt.tm_isdst = -1; |
| 569 | 576 | jsTime = (cson_int_t)mktime(>); |
| 570 | 577 |
| --- src/json.c | |
| +++ src/json.c | |
| @@ -558,12 +558,19 @@ | |
| 558 | SET("fossil"); |
| 559 | |
| 560 | {/* "timestamp" */ |
| 561 | cson_int_t jsTime; |
| 562 | #if 1 |
| 563 | /* Ge Weijers has pointed out that time(0) commonly returns |
| 564 | GMT, but is not required to by the standard. |
| 565 | */ |
| 566 | time_t const t = (time_t)time(0); |
| 567 | struct tm gt = *gmtime(&t); |
| 568 | gt.tm_isdst = -1; |
| 569 | jsTime = (cson_int_t)mktime(>); |
| 570 |
| --- src/json.c | |
| +++ src/json.c | |
| @@ -558,12 +558,19 @@ | |
| 558 | SET("fossil"); |
| 559 | |
| 560 | {/* "timestamp" */ |
| 561 | cson_int_t jsTime; |
| 562 | #if 1 |
| 563 | jsTime = (cson_int_t)time(0); |
| 564 | #elif 1 |
| 565 | /* Ge Weijers has pointed out that time(0) commonly returns |
| 566 | UTC, but is not required to by The Standard. |
| 567 | |
| 568 | There is a mkfmtime() function in cgi.c but it requires |
| 569 | a (tm *), and i don't have that without calling gmtime() |
| 570 | or populating the tm myself (which is what i'm trying to |
| 571 | have done for me!). |
| 572 | */ |
| 573 | time_t const t = (time_t)time(0); |
| 574 | struct tm gt = *gmtime(&t); |
| 575 | gt.tm_isdst = -1; |
| 576 | jsTime = (cson_int_t)mktime(>); |
| 577 |