Check-in [0b36f02f15]
Not logged in
Overview

SHA1 Hash:0b36f02f158e46419a0d693dfcbb42773f2e27d0
Date: 2008-11-01 20:56:59
User: drh
Comment: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.
Timelines: ancestors | descendants | both | trunk
Other Links: files | ZIP archive | manifest

Tags And Properties
Changes
[hide diffs]

Modified src/main.c from [89f5fcc95e] to [a407a1b98e].

@@ -76,10 +76,11 @@
   int fullHttpReply;      /* True for full HTTP reply.  False for CGI reply */
   Th_Interp *interp;      /* The TH1 interpreter */
   FILE *httpIn;           /* Accept HTTP input from here */
   FILE *httpOut;          /* Send HTTP output here */
   int xlinkClusterOnly;   /* Set when cloning.  Only process clusters */
+  int fTimeFormat;        /* 1 for UTC.  2 for localtime.  0 not yet selected */
 
   int *aCommitFile;       /* Array of files to be committed */
 
   int urlIsFile;          /* True if a "file:" url */
   char *urlName;          /* Hostname for http: or filename for file: */

Modified src/setup.c from [81e7ca4aa6] to [6880ca8def].

@@ -670,11 +670,11 @@
   @ <p>In timeline displays, check-in comments can be displayed with or
   @ without block markup (paragraphs, tables, etc.)</p>
 
   @ <hr>
   onoff_attribute("Use Universal Coordinated Time (UTC)",
-                  "timeline-utc", "utc", 0);
+                  "timeline-utc", "utc", 1);
   @ <p>Show times as UTC (also sometimes called Greenwich Mean Time (GMT) or
   @ Zulu) instead of in local time.</p>
 
   @ <hr>
   entry_attribute("Max timeline comment length", 6,

Modified src/timeline.c from [0274c8cadd] to [08490786af].

@@ -667,17 +667,18 @@
 ** by default.  Except if the timeline-utc property is set, this routine
 ** uses gmttime() instead.  Thus by setting the timeline-utc property, we
 ** can get all localtimes to be displayed at UTC time.
 */
 struct tm *fossil_localtime(const time_t *clock){
-  static int once = 1;
-  static int useUtc = 0;
-  if( once ){
-    useUtc = db_get_int("timeline-utc", 0);
-    once = 0;
+  if( g.fTimeFormat==0 ){
+    if( db_get_int("timeline-utc", 1) ){
+      g.fTimeFormat = 1;
+    }else{
+      g.fTimeFormat = 2;
+    }
   }
-  if( useUtc ){
+  if( g.fTimeFormat==1 ){
     return gmtime(clock);
   }else{
     return localtime(clock);
   }
 }