Fossil SCM
Make UTC time display the default. You can still set up a server to show localtime but that requires changing a setting under setup/timeline.
Commit
0b36f02f158e46419a0d693dfcbb42773f2e27d0
Parent
d23b8ba62ba9044…
3 files changed
+1
+1
-1
+7
-6
+1
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -76,10 +76,11 @@ | ||
| 76 | 76 | int fullHttpReply; /* True for full HTTP reply. False for CGI reply */ |
| 77 | 77 | Th_Interp *interp; /* The TH1 interpreter */ |
| 78 | 78 | FILE *httpIn; /* Accept HTTP input from here */ |
| 79 | 79 | FILE *httpOut; /* Send HTTP output here */ |
| 80 | 80 | int xlinkClusterOnly; /* Set when cloning. Only process clusters */ |
| 81 | + int fTimeFormat; /* 1 for UTC. 2 for localtime. 0 not yet selected */ | |
| 81 | 82 | |
| 82 | 83 | int *aCommitFile; /* Array of files to be committed */ |
| 83 | 84 | |
| 84 | 85 | int urlIsFile; /* True if a "file:" url */ |
| 85 | 86 | char *urlName; /* Hostname for http: or filename for file: */ |
| 86 | 87 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -76,10 +76,11 @@ | |
| 76 | int fullHttpReply; /* True for full HTTP reply. False for CGI reply */ |
| 77 | Th_Interp *interp; /* The TH1 interpreter */ |
| 78 | FILE *httpIn; /* Accept HTTP input from here */ |
| 79 | FILE *httpOut; /* Send HTTP output here */ |
| 80 | int xlinkClusterOnly; /* Set when cloning. Only process clusters */ |
| 81 | |
| 82 | int *aCommitFile; /* Array of files to be committed */ |
| 83 | |
| 84 | int urlIsFile; /* True if a "file:" url */ |
| 85 | char *urlName; /* Hostname for http: or filename for file: */ |
| 86 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -76,10 +76,11 @@ | |
| 76 | int fullHttpReply; /* True for full HTTP reply. False for CGI reply */ |
| 77 | Th_Interp *interp; /* The TH1 interpreter */ |
| 78 | FILE *httpIn; /* Accept HTTP input from here */ |
| 79 | FILE *httpOut; /* Send HTTP output here */ |
| 80 | int xlinkClusterOnly; /* Set when cloning. Only process clusters */ |
| 81 | int fTimeFormat; /* 1 for UTC. 2 for localtime. 0 not yet selected */ |
| 82 | |
| 83 | int *aCommitFile; /* Array of files to be committed */ |
| 84 | |
| 85 | int urlIsFile; /* True if a "file:" url */ |
| 86 | char *urlName; /* Hostname for http: or filename for file: */ |
| 87 |
+1
-1
| --- src/setup.c | ||
| +++ src/setup.c | ||
| @@ -670,11 +670,11 @@ | ||
| 670 | 670 | @ <p>In timeline displays, check-in comments can be displayed with or |
| 671 | 671 | @ without block markup (paragraphs, tables, etc.)</p> |
| 672 | 672 | |
| 673 | 673 | @ <hr> |
| 674 | 674 | onoff_attribute("Use Universal Coordinated Time (UTC)", |
| 675 | - "timeline-utc", "utc", 0); | |
| 675 | + "timeline-utc", "utc", 1); | |
| 676 | 676 | @ <p>Show times as UTC (also sometimes called Greenwich Mean Time (GMT) or |
| 677 | 677 | @ Zulu) instead of in local time.</p> |
| 678 | 678 | |
| 679 | 679 | @ <hr> |
| 680 | 680 | entry_attribute("Max timeline comment length", 6, |
| 681 | 681 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -670,11 +670,11 @@ | |
| 670 | @ <p>In timeline displays, check-in comments can be displayed with or |
| 671 | @ without block markup (paragraphs, tables, etc.)</p> |
| 672 | |
| 673 | @ <hr> |
| 674 | onoff_attribute("Use Universal Coordinated Time (UTC)", |
| 675 | "timeline-utc", "utc", 0); |
| 676 | @ <p>Show times as UTC (also sometimes called Greenwich Mean Time (GMT) or |
| 677 | @ Zulu) instead of in local time.</p> |
| 678 | |
| 679 | @ <hr> |
| 680 | entry_attribute("Max timeline comment length", 6, |
| 681 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -670,11 +670,11 @@ | |
| 670 | @ <p>In timeline displays, check-in comments can be displayed with or |
| 671 | @ without block markup (paragraphs, tables, etc.)</p> |
| 672 | |
| 673 | @ <hr> |
| 674 | onoff_attribute("Use Universal Coordinated Time (UTC)", |
| 675 | "timeline-utc", "utc", 1); |
| 676 | @ <p>Show times as UTC (also sometimes called Greenwich Mean Time (GMT) or |
| 677 | @ Zulu) instead of in local time.</p> |
| 678 | |
| 679 | @ <hr> |
| 680 | entry_attribute("Max timeline comment length", 6, |
| 681 |
+7
-6
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -667,17 +667,18 @@ | ||
| 667 | 667 | ** by default. Except if the timeline-utc property is set, this routine |
| 668 | 668 | ** uses gmttime() instead. Thus by setting the timeline-utc property, we |
| 669 | 669 | ** can get all localtimes to be displayed at UTC time. |
| 670 | 670 | */ |
| 671 | 671 | struct tm *fossil_localtime(const time_t *clock){ |
| 672 | - static int once = 1; | |
| 673 | - static int useUtc = 0; | |
| 674 | - if( once ){ | |
| 675 | - useUtc = db_get_int("timeline-utc", 0); | |
| 676 | - once = 0; | |
| 672 | + if( g.fTimeFormat==0 ){ | |
| 673 | + if( db_get_int("timeline-utc", 1) ){ | |
| 674 | + g.fTimeFormat = 1; | |
| 675 | + }else{ | |
| 676 | + g.fTimeFormat = 2; | |
| 677 | + } | |
| 677 | 678 | } |
| 678 | - if( useUtc ){ | |
| 679 | + if( g.fTimeFormat==1 ){ | |
| 679 | 680 | return gmtime(clock); |
| 680 | 681 | }else{ |
| 681 | 682 | return localtime(clock); |
| 682 | 683 | } |
| 683 | 684 | } |
| 684 | 685 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -667,17 +667,18 @@ | |
| 667 | ** by default. Except if the timeline-utc property is set, this routine |
| 668 | ** uses gmttime() instead. Thus by setting the timeline-utc property, we |
| 669 | ** can get all localtimes to be displayed at UTC time. |
| 670 | */ |
| 671 | struct tm *fossil_localtime(const time_t *clock){ |
| 672 | static int once = 1; |
| 673 | static int useUtc = 0; |
| 674 | if( once ){ |
| 675 | useUtc = db_get_int("timeline-utc", 0); |
| 676 | once = 0; |
| 677 | } |
| 678 | if( useUtc ){ |
| 679 | return gmtime(clock); |
| 680 | }else{ |
| 681 | return localtime(clock); |
| 682 | } |
| 683 | } |
| 684 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -667,17 +667,18 @@ | |
| 667 | ** by default. Except if the timeline-utc property is set, this routine |
| 668 | ** uses gmttime() instead. Thus by setting the timeline-utc property, we |
| 669 | ** can get all localtimes to be displayed at UTC time. |
| 670 | */ |
| 671 | struct tm *fossil_localtime(const time_t *clock){ |
| 672 | if( g.fTimeFormat==0 ){ |
| 673 | if( db_get_int("timeline-utc", 1) ){ |
| 674 | g.fTimeFormat = 1; |
| 675 | }else{ |
| 676 | g.fTimeFormat = 2; |
| 677 | } |
| 678 | } |
| 679 | if( g.fTimeFormat==1 ){ |
| 680 | return gmtime(clock); |
| 681 | }else{ |
| 682 | return localtime(clock); |
| 683 | } |
| 684 | } |
| 685 |