1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Fix a round-off error in the %W and %j conversions of the strftime() function.

Ticket #2150. (CVS 3570)

FossilOrigin-Name: 52067937803e6b36afc8f11c5d24059414208b77
This commit is contained in:
drh
2007-01-08 13:07:30 +00:00
parent f742d78326
commit c2c9eef6b3
4 changed files with 22 additions and 11 deletions

View File

@@ -16,7 +16,7 @@
** sqlite3RegisterDateTimeFunctions() found at the bottom of the file.
** All other code has file scope.
**
** $Id: date.c,v 1.58 2006/09/25 18:05:04 drh Exp $
** $Id: date.c,v 1.59 2007/01/08 13:07:30 drh Exp $
**
** NOTES:
**
@@ -840,7 +840,7 @@ static void strftimeFunc(
y.M = 1;
y.D = 1;
computeJD(&y);
nDay = x.rJD - y.rJD;
nDay = x.rJD - y.rJD + 0.5;
if( zFmt[i]=='W' ){
int wd; /* 0=Monday, 1=Tuesday, ... 6=Sunday */
wd = ((int)(x.rJD+0.5)) % 7;