SQLite

Check-in [248b550090]
Login

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

Overview
Comment:Fix a bug in the HH:MM:SS modifier change that was just checked in. (CVS 1278)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 248b5500900bc8f401006aaa9b7dac090ae419fa
User & Date: drh 2004-02-29 00:48:09.000
Context
2004-02-29
00:50
Try again to get the HH:MM:SS modifier change right... (CVS 1279) (check-in: e20d51f94e user: drh tags: trunk)
00:48
Fix a bug in the HH:MM:SS modifier change that was just checked in. (CVS 1278) (check-in: 248b550090 user: drh tags: trunk)
00:40
Allow time modifiers of the form HH:MM:SS.SSS with an option "+" or "-" prefix. The specified amount of time is added into the date-time begin modified. (CVS 1277) (check-in: 559002a52f user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/date.c.
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
** This file contains the C functions that implement date and time
** functions for SQLite.  
**
** There is only one exported symbol in this file - the function
** sqliteRegisterDateTimeFunctions() found at the bottom of the file.
** All other code has file scope.
**
** $Id: date.c,v 1.13 2004/02/29 00:40:32 drh Exp $
**
** NOTES:
**
** SQLite processes all times and dates as Julian Day numbers.  The
** dates and times are stored as the number of days since noon
** in Greenwich on November 24, 4714 B.C. according to the Gregorian
** calendar system.







|







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
** This file contains the C functions that implement date and time
** functions for SQLite.  
**
** There is only one exported symbol in this file - the function
** sqliteRegisterDateTimeFunctions() found at the bottom of the file.
** All other code has file scope.
**
** $Id: date.c,v 1.14 2004/02/29 00:48:09 drh Exp $
**
** NOTES:
**
** SQLite processes all times and dates as Julian Day numbers.  The
** dates and times are stored as the number of days since noon
** in Greenwich on November 24, 4714 B.C. according to the Gregorian
** calendar system.
575
576
577
578
579
580
581


582
583
584
585
586
587
588
        const char *z2 = z;
        DateTime tx;
        int day;
        if( !isdigit(*z2) ) z2++;
        memset(&tx, 0, sizeof(tx));
        if( parseHhMmSs(z2, &tx) ) break;
        computeJD(&tx);


        if( z[0]=='-' ) tx.rJD = -tx.rJD;
        day = (int)tx.rJD;
        p->rJD += tx.rJD - day;
        rc = 0;
        break;
      }
      z += n;







>
>







575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
        const char *z2 = z;
        DateTime tx;
        int day;
        if( !isdigit(*z2) ) z2++;
        memset(&tx, 0, sizeof(tx));
        if( parseHhMmSs(z2, &tx) ) break;
        computeJD(&tx);
        computeJD(p);
        clearYMD_HMS_TZ(p);
        if( z[0]=='-' ) tx.rJD = -tx.rJD;
        day = (int)tx.rJD;
        p->rJD += tx.rJD - day;
        rc = 0;
        break;
      }
      z += n;