diff options
author | drh <drh@noemail.net> | 2009-04-16 12:58:03 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2009-04-16 12:58:03 +0000 |
commit | 7fee360d0934d56c53c0965a726205356b3efe98 (patch) | |
tree | b949d3085b3a854ce56ba9c30ca293dee6db17b5 /src | |
parent | 10c081adf8eaebcccf13e1a1db7c5ed38ace16c5 (diff) | |
download | sqlite-7fee360d0934d56c53c0965a726205356b3efe98.tar.gz sqlite-7fee360d0934d56c53c0965a726205356b3efe98.zip |
Make sure the 'unixepoch' converter in the date and time functions rounds
to the nearest millisecond rather than truncating downward to the next
smaller millisecond. Ticket #3808. (CVS 6512)
FossilOrigin-Name: e6e036b345b130c207716c4b81719b5b7c884a11
Diffstat (limited to 'src')
-rw-r--r-- | src/date.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/date.c b/src/date.c index 5b1de72f8..a1768040f 100644 --- a/src/date.c +++ b/src/date.c @@ -16,7 +16,7 @@ ** sqlite3RegisterDateTimeFunctions() found at the bottom of the file. ** All other code has file scope. ** -** $Id: date.c,v 1.105 2009/04/03 12:04:37 drh Exp $ +** $Id: date.c,v 1.106 2009/04/16 12:58:03 drh Exp $ ** ** SQLite processes all times and dates as Julian Day numbers. The ** dates and times are stored as the number of days since noon @@ -549,7 +549,7 @@ static int parseModifier(const char *zMod, DateTime *p){ ** seconds since 1970. Convert to a real julian day number. */ if( strcmp(z, "unixepoch")==0 && p->validJD ){ - p->iJD = p->iJD/86400 + 21086676*(i64)10000000; + p->iJD = (p->iJD + 43200)/86400 + 21086676*(i64)10000000; clearYMD_HMS_TZ(p); rc = 0; } |