Fossil

Check-in [0b36f02f]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
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.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:0b36f02f158e46419a0d693dfcbb42773f2e27d0
User & Date: drh 2008-11-01 20:56:59
Context
2008-11-02
18:22
Add submenu entries on timeline pages for selecting options such as "tickets only" and "200 entries per page" and so forth. check-in: c9cd128c user: drh tags: trunk
2008-11-01
20:56
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. check-in: 0b36f02f user: drh tags: trunk
20:48
Update SQLite to the latest in CVS (version 3.6.4+). Add a configuration option to show all times in UTC instead of localtime. check-in: d23b8ba6 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/main.c.

74
75
76
77
78
79
80

81
82
83
84
85
86
87
  Blob cgiIn;             /* Input to an xfer www method */
  int cgiPanic;           /* Write error messages to CGI */
  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 *aCommitFile;       /* Array of files to be committed */

  int urlIsFile;          /* True if a "file:" url */
  char *urlName;          /* Hostname for http: or filename for file: */
  char *urlHostname;      /* The HOST: parameter on http headers */
  int urlPort;            /* TCP port number for http: */







>







74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
  Blob cgiIn;             /* Input to an xfer www method */
  int cgiPanic;           /* Write error messages to CGI */
  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: */
  char *urlHostname;      /* The HOST: parameter on http headers */
  int urlPort;            /* TCP port number for http: */

Changes to src/setup.c.

668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
  onoff_attribute("Allow block-markup in timeline",
                  "timeline-block-markup", "tbm", 0);
  @ <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);
  @ <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, 
                  "timeline-max-comment", "tmc", "0");
  @ <p>The maximum length of a comment to be displayed in a timeline.







|







668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
  onoff_attribute("Allow block-markup in timeline",
                  "timeline-block-markup", "tbm", 0);
  @ <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", 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, 
                  "timeline-max-comment", "tmc", "0");
  @ <p>The maximum length of a comment to be displayed in a timeline.

Changes to src/timeline.c.

665
666
667
668
669
670
671
672
673
674
675


676
677
678


679
680
681
682
683
**
** This modified version of localtime() works like the library localtime()
** 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( useUtc ){


    return gmtime(clock);
  }else{
    return localtime(clock);
  }
}







|
<
<
|
>
>
|
|
<
>
>





665
666
667
668
669
670
671
672


673
674
675
676
677

678
679
680
681
682
683
684
**
** This modified version of localtime() works like the library localtime()
** 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){
  if( g.fTimeFormat==0 ){


    if( db_get_int("timeline-utc", 1) ){
      g.fTimeFormat = 1;
    }else{
      g.fTimeFormat = 2;
    }

  }
  if( g.fTimeFormat==1 ){
    return gmtime(clock);
  }else{
    return localtime(clock);
  }
}