aboutsummaryrefslogtreecommitdiff
path: root/src/date.c
AgeCommit message (Collapse)AuthorLines
12 daysThe 'utc' time modifier should not cancel 'subsec'.drh-0/+3
[bugs:/info/2026-11-05T22:11:32Z|Bug 2026-11-05T22:11:32Z] FossilOrigin-Name: 2d7042c18ca995b46bb5731d7f8e2a02c94b3b1317f71269f026fae0c87c8ad8
2026-11-10Do not allow timezones on a HH:MM:SS offset modifier.drh-7/+10
FossilOrigin-Name: 4b7348afb403010f83bea71d76721b5c8322f577f1166f3aeccc2a8c488c23fb
2026-11-10Clean up excess commentary in the initial prototype fix.drh-17/+9
FossilOrigin-Name: 80e3541043bef35781b873efcc379e947f0d7c666c8cbe1e84ad22338914bf7c
2026-11-07Experimental AI-assisted proof of concept for date modifier reports ↵karl-2/+23
7757ac1132, 3cc3a0207e, e0fe679e7c. Claude Opus 5.5 high candidate; Gemini 4 Argon high review; Codex fleet supervisor validation. Based on trunk 9a42b5817055e6ad. Maintainer review required. FossilOrigin-Name: 82ba76b277e3ff6926d5f5ea365aca3f942da07cdef3bfd75906ef25638ec736
2026-10-17Fix 24:00:00 rounding of dates with negative years.drh-1/+2
[forum:/info/2026-10-17T12:57:32Z|Forum post 2026-10-17T12:57:32Z] FossilOrigin-Name: 91515aa82e05f32db4b5d126d762d730cf424735edc4ef59a696ad581f4ca1ab
2026-10-15Fixes to the handling of time 24:00:00.drh-17/+32
[forum:/info/2026-10-15T10:26:06Z|Forum post 2026-10-15T10:26:06Z] FossilOrigin-Name: 69071e25cad52b7fe15749f5fb969e847f9cd65e66341e8d1d4e5f5282283cd4
2026-09-24In date/time functions, the hour can be 24 as long as the minutes anddrh-0/+9
seconds are zero. [bugs:/info/2026-09-23T02:44:48Z|Bug 2026-09-23T02:44:48Z] FossilOrigin-Name: 52eec02592f9d0d2d4282c20cc0872215c8d88e17f1a3e34d2ccab48119f7c42
2026-07-11Minor change to the "weekday N" modifier in the date/time functionsdrh-1/+1
to facilitate 100% mutation test coverage. FossilOrigin-Name: 76002a6f5de2dadb49ea76571fe395b9c8e261b380068fd2ea88f8326f268109
2026-07-01Add "end of day/month/year" modifiers to date/time functions.drh-1/+46
FossilOrigin-Name: 2c4cb3223c6c56d05fe91b8d19b60eac26a274e41f34a2d8f2cf911927581932
2026-07-01Enhance the "weekday N" modifier for date/time functions such that ifdrh-7/+15
the argument is negative, it move the date backwards in time to the matching weekday, rather than forwards. FossilOrigin-Name: e31bea6ce188fb3ae2d8da132a40a182431d701dc6b991af470337a1cdd3f8e4
2026-06-19Use SQLITE_FINISH in a few places in the core, to help ensure that path isdrh-30/+30
well tested. FossilOrigin-Name: 7356bf3a813bcd9082a7fdef5e2cc38c7a0f142f0ef4c948f78e4dafa216c039
2026-06-19Further refinements and uses for sqlite3_result_str().drh-2/+2
FossilOrigin-Name: 974253a6058a7120354261b2134ed4803373031996957c7334161370b80bf428
2026-02-26Fix an inconsequential typo in the output of the datedebug() SQL function.drh-1/+1
FossilOrigin-Name: 3a92a53d8cf77822c22618dbf35851a20d27c4a659d23db2d24e7ccb3f61c7fc
2026-02-16Refactor the sqlite3AtoF() routine so that it requires a zero-terminateddrh-4/+10
UTF-8 input. When the need arises to convert UTF16 or non-terminated strings, wrapper functions are used. Together, this makes the code slightly smaller and faster. FossilOrigin-Name: 67c7c72e9bdf04c920d77006538a202c923fa74b47c81dc3014c2929dac7277d
2025-09-28Fix harmless typo in a comment.drh-2/+2
FossilOrigin-Name: 1f6deabfff2fc2fed5fbff48d2637b48245e5a946a442c4bcc9b9ecb7c4848b9
2025-09-17In the date/time functions, a timezone suffix of "+00:00" should workdrh-0/+4
the same as "Z". [forum:/forumpost/2025-09-17T10:12:14z|Forum post 2025-09-17T10:12:14z]. FossilOrigin-Name: 3b7a5babf0843c4b3ce93d26f1447218585ce645ec3acd942ac649204e16675a
2025-02-27Approximately 100 typo corrections spanning the whole tree, submitted via ↵stephan-1/+1
[forum:0db9827f0464bc33|forum post 0db9827f0464bc33] and individually audited and verified. Affects only code comments, innocuous test strings, error message text in tool (not library) code, and configure-level help text. FossilOrigin-Name: f50c21484d3cac73589da0376c423de39ae8b842218105786c5aa3726e4dcaed
2025-01-21Fix date/time computations to deal with the sub-millisecond roundingdrh-1/+4
problem identified in [forum:/forumpost/766a2c9231|forum post 766a2c9231]. FossilOrigin-Name: afb0a5923a6db4045fab5226198aab970d746d4866294ebba943c6986e97ecde
2024-08-19Attempt to fix date/time calculations for days earlier than 0400-03-01.drh-5/+5
See [forum:/forumpost/eaa0a09786c6368b|forum thread eaa0a09786c6368b]. FossilOrigin-Name: 00cae11fffaf50e2133915e851d41098d00b6b1458e1438bcb6664e1411d8498
2024-06-11Change constant expressions to pre-computed constants, because apparentlydrh-2/+2
MSVC on ARM requires that. [forum:/forumpost/4feb1685cced0a8e|Forum thread 4feb1685cced0a8e]. FossilOrigin-Name: 6c103aee6f146869a3e0c48694592f2e4c6b57ecdb4450f46e762c38b4e686f1
2024-03-04Fix a compiler warning in date.c. Update makefiles to include all necessarydrh-1/+1
dependencies for building shell.c. FossilOrigin-Name: 178b7d46f9c8e1694ed6f506d2785a9f5c49e2b428e04c8096d557cc1b5c9680
2024-03-04Adjust date/time functions so that they do a better job of keeping trackdrh-18/+60
of whether the current time is UTC or localtime, and no-op the 'utc' and 'localtime' modifiers accordingly. See [forum:/info/e7a939e074|forum post e7a939e074]. Also add the datedebug() function, available only under -DSQLITE_DEBUG, for improved visibility of the DateTime object during debugging and testing. FossilOrigin-Name: dc569683748354a6db83438904422e802d3ea780775c48da85b474fff03ca8a1
2024-03-04Fix assert() statements in date/time computations: The month and day numbersdrh-3/+3
can be zero if an error has been seen. FossilOrigin-Name: fc773f6c76ec114be8b6e25b13885acb5adcc9d052dca0d8d0ff94e2a0743d64
2024-03-03Back out the previous change. Replace it with new date modifiers "ceiling"drh-25/+75
and "floor". FossilOrigin-Name: f0831cced2c919e409214d936c81473ae321a98c5bd78b5b729c1269bf71bc45
2024-03-02Change the magic time-interval names that do truncate-to-same-month to bedrh-19/+19
"mnth" and "yr" - "month" and "year" without the vowels. FossilOrigin-Name: 296b46c529d79385d7f4db2c789254a992c01ff66fe8ba6d3a3ce4aaac0203fb
2024-03-02Proof-of-concept for new time-interval operator "pg-month" and "pg-year" thatdrh-9/+26
use the truncate-to-month algorithm for month overflow instead of the wrap-to-next-month algorithm that is used by SQLite by default. FossilOrigin-Name: b606c0965788f56547435c9318b60e32990877e14a9640d887f33f39d1bdc7c3
2024-01-21Fix a harmless typo in a comment.drh-1/+2
FossilOrigin-Name: 382a8f94bffef3e5f715116e363a30e21e2c53cd42d4959dfbe90c4624143e6d
2024-01-20Simplifications to the strftime() logic.drh-26/+38
FossilOrigin-Name: aaa5a044d8a4942278eb4269fa8c7252f9f1dc161408e618e7c97c55a12283ff
2024-01-20Implement a new algorithm for computing ISO week values in strftime() baseddrh-45/+16
on the idea (from [forum/forumpost/3681cb1bcd|Nuno Cruces]) of shifting the date being tested to the Thursday of the same week. FossilOrigin-Name: b06ab46a9ee98719159ed3e05cdfbf26281353d781206f56ed7cb12859210fed
2024-01-18Add support in the strftime() SQL function for conversion letters %G, %g,drh-24/+122
%U, and %V. FossilOrigin-Name: e1155d6aa4b960ecfd14fa3467f28672af3327699c547f5b9e75da3ac1348ff7
2023-11-04Ensure that the YYYY-MM-DD input to date and time functions has been normalizeddrh-0/+6
prior to returning a result. [forum:/forumpost/6bb476897e|Forum post 6bb476897e]. FossilOrigin-Name: b692eb8ccb2d0645599ad73a8bdacf5df499114244aadeb38aabc580fc4dc7c5
2023-08-29New conversion letters added to strftime(): %e, %k, %I, %l, %R, %P, %p, %T, %u.drh-8/+43
FossilOrigin-Name: 058722b2d0b995195a8ce3effe9722ae1c18cb1e7a520b481030da0bd579fe41
2023-06-19Fix large integer constants so that they work on older C compilers.drh-2/+2
FossilOrigin-Name: 3c94f87806a8b408d8204fc7deec16d01c085ee199ff21a1f20b6346ce816cfe
2023-06-17In date/time functions, fix the rendering of "subsecond" and thedrh-42/+8
computeHMS() routine to better deal with floating point rounding errors that arise on some 32-bit systems. FossilOrigin-Name: e46a00ae880dd12df090105498a85017d1367f88bf27d86f0b0200cf0536a906
2023-06-16Address various harmless compiler warnings fromdrh-3/+4
[forum:/forumpost/d526da8ee4|forum post d526da8ee4]. FossilOrigin-Name: 365caf2f97e8f15842f52536e8d05d359e9d6e863182e020ce14a9a9f27ee057
2023-06-14Work around what appears to be a GCC 32-bit optimization problem in thedrh-0/+31
computeHMS() routine of the date/time logic. FossilOrigin-Name: aebdbcbebff1319dd00551c9fb9ad4b08859f10e87f097295d564ae1ba188c02
2023-06-13Extended the time-diff format so that it can have a 5-digit year. This enablesdrh-12/+21
time differences to span the full range of dates supported by SQLite. Also fix some inaccuracies in the computation of time differences and add new test cases. FossilOrigin-Name: d57ddbf4eeeb3ccfe31871f098045b9e58634153a3c3030f597cb58c1177218a
2023-06-07Fix straggler misspellings and tidy the custom dictionary. Also include ↵larrybr-1/+1
pickups from [forum:/info/c61fb09afd|forum post c61fb09afd]. FossilOrigin-Name: 8c291d99946eb32b20b743921202f9c7cfb716268ff526817b27adbb7942e40b
2023-05-30Simplifications to the new timediff() logic.drh-19/+7
FossilOrigin-Name: d6954259bd3f8475f3804fd02a1591d037efa9df54da45776863c024ff90e596
2023-05-30All date/time modifiers of the form (+/-)YYYY-MM-DD without the followingdrh-4/+14
HH:MM:SS.SSS. FossilOrigin-Name: fa9237a8ab803ca3f67fe753516b7bdb98be3d625e8e241ddf9b02509210e225
2023-05-30Problems fixed. All tests are passing now.drh-6/+4
FossilOrigin-Name: cff293b0a79107def7bfe54fd60ac4a721c5098c85229d9b46a4e2c4cbf34a6a
2023-05-30Improvements to the timediff() function. Test cases added. Not all testdrh-15/+85
cases are passing. FossilOrigin-Name: 2cf6518140d61e2123dc20f39d7e97e7bce17e7641405df7fd63e1cdda444ae0
2023-05-29New date/time modifier: (+|-)YYYY-MM-DD HH:MM(:SS.SSS)?drh-2/+36
FossilOrigin-Name: 3832b8a9ef84d9b53b48dfce9c1e724897cd7b3e05711e01675419655f894eac
2023-05-29Prototype implementation of a proposed "timediff(X,Y)" SQL function.drh-13/+77
FossilOrigin-Name: 054a195125a273bab026ada5f07cc7c32818007027a1fd028ca59d2f179276d4
2023-04-21Add a new modifier to date/time functions: "subsecond". May bedrh-18/+73
abbreviated as just "subsec". This modifier causes functions to try to show fractional seconds if they do not already. FossilOrigin-Name: 03f2a15e8779d8ca76510badeabde62a0539ce8a6368d7a9688f5aadc215b940
2023-02-11Change a variable from 32 to 64-bits to avoid a harmless compiler warningdrh-1/+1
in Xcode. [forum:/forumpost/402d733c22|Forum post 402d733c22]. FossilOrigin-Name: 0216ce23cf23bc147c5de6de178a6689b7ad744bf0ee0098809938b5fe10708b
2023-02-08Back out the 'txn' enhancement to date/time functions. The duration of adrh-21/+12
"transaction" is confused and needs to be straightened out prior to moving forward with this change. FossilOrigin-Name: 4a145f07322d768a07619bed27e0390d50f3a01d07787b9296234a5ceb6f1218
2023-02-08Revert the behavior of date/time functions with no arguments so that theydrh-7/+10
once again work like 'now', even while CURRENT_TIMESTAMP and similar work like 'txn'. FossilOrigin-Name: 06180caff0f5d8aba83b9f7be682ccdd6cb2ffc228b557ee6c1fd00fe5c23e92
2023-02-08Change the behavior of date-time functions without any arguments (and thusdrh-2/+2
the CURRENT_TIME, CURRENT_DATE, and CURRENT_TIMESTAMP variables) so that they work like 'txn' instead of like 'now'. This is an incompatibility with legacy, but brings SQLite into conformance with all other SQL systems. FossilOrigin-Name: 1ac78be54502779236645eac35b962797f2fb98307d059d2aa19658c4fa74cb7
2023-02-07Simplify the code and add test cases.drh-21/+6
FossilOrigin-Name: d3bed4caff561e71c396cc869c5b4d9bf216ba203485e738c12ec62741f1aba5