/ Check-in [71486e93]
Login

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

Overview
Comment:Add an SQLITE_OMIT_LOCALTIME around the "utc" modifier in date/time functions. (CVS 5483)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 71486e93b274b7ca954314dd3e4146192a8b6d79
User & Date: drh 2008-07-25 16:39:25
Context
2008-07-26
18:26
Fix a case where database corruption was causing an invalid reference. (CVS 5484) check-in: 7aecabac user: danielk1977 tags: trunk
2008-07-25
16:39
Add an SQLITE_OMIT_LOCALTIME around the "utc" modifier in date/time functions. (CVS 5483) check-in: 71486e93 user: drh tags: trunk
16:07
Further performance improvements to mem6.c. (CVS 5482) check-in: 4528f7b1 user: danielk1977 tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Show Whitespace Changes Patch

Changes to src/date.c.

    12     12   ** This file contains the C functions that implement date and time
    13     13   ** functions for SQLite.  
    14     14   **
    15     15   ** There is only one exported symbol in this file - the function
    16     16   ** sqlite3RegisterDateTimeFunctions() found at the bottom of the file.
    17     17   ** All other code has file scope.
    18     18   **
    19         -** $Id: date.c,v 1.85 2008/06/18 17:09:10 danielk1977 Exp $
           19  +** $Id: date.c,v 1.86 2008/07/25 16:39:25 drh Exp $
    20     20   **
    21     21   ** SQLite processes all times and dates as Julian Day numbers.  The
    22     22   ** dates and times are stored as the number of days since noon
    23     23   ** in Greenwich on November 24, 4714 B.C. according to the Gregorian
    24     24   ** calendar system. 
    25     25   **
    26     26   ** 1970-01-01 00:00:00 is JD 2440587.5
................................................................................
   549    549         ** Treat the current value of p->iJD as the number of
   550    550         ** seconds since 1970.  Convert to a real julian day number.
   551    551         */
   552    552         if( strcmp(z, "unixepoch")==0 && p->validJD ){
   553    553           p->iJD = p->iJD/86400.0 + 2440587.5*86400000.0;
   554    554           clearYMD_HMS_TZ(p);
   555    555           rc = 0;
   556         -      }else if( strcmp(z, "utc")==0 ){
          556  +      }
          557  +#ifndef SQLITE_OMIT_LOCALTIME
          558  +      else if( strcmp(z, "utc")==0 ){
   557    559           double c1;
   558    560           computeJD(p);
   559    561           c1 = localtimeOffset(p);
   560    562           p->iJD -= c1;
   561    563           clearYMD_HMS_TZ(p);
   562    564           p->iJD += c1 - localtimeOffset(p);
   563    565           rc = 0;
   564    566         }
          567  +#endif
   565    568         break;
   566    569       }
   567    570       case 'w': {
   568    571         /*
   569    572         **    weekday N
   570    573         **
   571    574         ** Move the date to the same time on the next occurrence of