1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Enhance date/time functions to work with negative years. Ticket #617. (CVS 1255)

FossilOrigin-Name: ffa971934867b6bbe943c004154d5f161e0ea697
This commit is contained in:
drh
2004-02-21 03:28:18 +00:00
parent 8307ac7521
commit 8eb2cce55c
4 changed files with 32 additions and 19 deletions

View File

@ -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.5 2004/01/07 03:29:16 drh Exp $
# $Id: date.test,v 1.6 2004/02/21 03:28:18 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -201,5 +201,15 @@ datetest 8.18 {datetime('now','-1.25 hours')} {2003-10-22 11:19:00}
datetest 8.19 {datetime('now','11.25 seconds')} {2003-10-22 12:34:11}
set sqlite_current_time 0
# Negative years work. Example: '-4713-11-26' is JD 1.5.
#
datetest 9.1 {julianday('-4713-11-24 12:00:00')} {0}
datetest 9.2 {julianday(datetime(5))} {5}
datetest 9.3 {julianday(datetime(10))} {10}
datetest 9.4 {julianday(datetime(100))} {100}
datetest 9.5 {julianday(datetime(1000))} {1000}
datetest 9.6 {julianday(datetime(10000))} {10000}
datetest 9.7 {julianday(datetime(100000))} {100000}
finish_test