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:
parent
f742d78326
commit
c2c9eef6b3
14
manifest
14
manifest
@ -1,5 +1,5 @@
|
||||
C Another\stypo\sfixed\sin\schanges.html\s(CVS\s3569)
|
||||
D 2007-01-06T13:11:36
|
||||
C Fix\sa\sround-off\serror\sin\sthe\s%W\sand\s%j\sconversions\sof\sthe\sstrftime()\sfunction.\nTicket\s#2150.\s(CVS\s3570)
|
||||
D 2007-01-08T13:07:30
|
||||
F Makefile.in a3fb1f739fd807bb3f496bd3dc41ed2b81d25e22
|
||||
F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935
|
||||
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
|
||||
@ -62,7 +62,7 @@ F src/btree.h 061c50e37de7f50b58528e352d400cf33ead7418
|
||||
F src/build.c 02aedde724dc73295d6e9b8dc29afb5dd38de507
|
||||
F src/callback.c fd9bb39f7ff6b52bad8365617abc61c720640429
|
||||
F src/complete.c 7d1a44be8f37de125fcafd3d3a018690b3799675
|
||||
F src/date.c 9602457c49210f77f860d1919a8249a3118cd43f
|
||||
F src/date.c bc0828d380c6cd936b9d12c79cb9863f957456a3
|
||||
F src/delete.c 804384761144fe1a5035b99f4bd7d706976831bd
|
||||
F src/experimental.c 1b2d1a6cd62ecc39610e97670332ca073c50792b
|
||||
F src/expr.c 3d2cf15fd9aa6b60b67f45504782cce72cd07963
|
||||
@ -184,7 +184,7 @@ F test/corrupt.test 18c7a995b1af76a8c8600b996257f2c7b7bff083
|
||||
F test/corrupt2.test 88342570828f2b8cbbd8369eff3891f5c0bdd5ba
|
||||
F test/crash.test 5f5f155393c5685b3842fef79b6fbafa55197d75
|
||||
F test/crashtest1.c 09c1c7d728ccf4feb9e481671e29dda5669bbcc2
|
||||
F test/date.test 03195d0491772c396cefc0614a4884df8f7f3747
|
||||
F test/date.test d46b7fa0c14cb6d79fee3be070d528bbe6f01c7d
|
||||
F test/default.test 252298e42a680146b1dd64f563b95bdf088d94fb
|
||||
F test/delete.test 525a6953bc3978780cae35f3eaf1027cf4ce887d
|
||||
F test/delete2.test c06be3806ba804bc8c6f134476816080280b40e3
|
||||
@ -424,7 +424,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9
|
||||
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
|
||||
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
|
||||
F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513
|
||||
P be410fee681554653756d170e45ce00f0c9477ab
|
||||
R be31d9045ac23ab231d5994bfb3c796e
|
||||
P 70033a0ea41e698237e886c7ab010a360ea53bb5
|
||||
R 43d559c37983aca4dc405f7d3292901f
|
||||
U drh
|
||||
Z 7b7b3e4ca626d571342283e00310b5fb
|
||||
Z cdcea05b63e559590a8737626d19a845
|
||||
|
@ -1 +1 @@
|
||||
70033a0ea41e698237e886c7ab010a360ea53bb5
|
||||
52067937803e6b36afc8f11c5d24059414208b77
|
@ -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;
|
||||
|
@ -11,7 +11,7 @@
|
||||
# This file implements regression tests for SQLite library. The
|
||||
# focus of this file is testing date and time functions.
|
||||
#
|
||||
# $Id: date.test,v 1.17 2006/09/25 18:03:29 drh Exp $
|
||||
# $Id: date.test,v 1.18 2007/01/08 13:07:30 drh Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@ -123,6 +123,17 @@ datetest 3.11.11 {strftime('%W','2004-07-18')} 28
|
||||
datetest 3.11.12 {strftime('%W','2004-12-31')} 52
|
||||
datetest 3.11.13 {strftime('%W','2007-12-31')} 53
|
||||
datetest 3.11.14 {strftime('%W','2007-01-01')} 01
|
||||
datetest 3.11.15 {strftime('%W %j',2454109.04140970)} {02 008}
|
||||
datetest 3.11.16 {strftime('%W %j',2454109.04140971)} {02 008}
|
||||
datetest 3.11.17 {strftime('%W %j',2454109.04140972)} {02 008}
|
||||
datetest 3.11.18 {strftime('%W %j',2454109.04140973)} {02 008}
|
||||
datetest 3.11.19 {strftime('%W %j',2454109.04140974)} {02 008}
|
||||
datetest 3.11.20 {strftime('%W %j',2454109.04140975)} {02 008}
|
||||
datetest 3.11.21 {strftime('%W %j',2454109.04140976)} {02 008}
|
||||
datetest 3.11.22 {strftime('%W %j',2454109.04140977)} {02 008}
|
||||
datetest 3.11.22 {strftime('%W %j',2454109.04140978)} {02 008}
|
||||
datetest 3.11.22 {strftime('%W %j',2454109.04140979)} {02 008}
|
||||
datetest 3.11.22 {strftime('%W %j',2454109.04140980)} {02 008}
|
||||
datetest 3.12 {strftime('%Y','2003-10-31 12:34:56.432')} 2003
|
||||
datetest 3.13 {strftime('%%','2003-10-31 12:34:56.432')} %
|
||||
datetest 3.14 {strftime('%_','2003-10-31 12:34:56.432')} NULL
|
||||
|
Loading…
x
Reference in New Issue
Block a user