Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/sqlite/blob/master/test/date4.test # sqlite [Ported from github.com/sqlite/sqlite] Fix bugs in and improve the interface to the ".check" command of the CLI. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `sqlite / test / date4.test` 44 lines ยท 1202 bytes Raw Blame History 1 # 2023-08-29 2 # 3 # The author disclaims copyright to this source code. In place of 4 # a legal notice, here is a blessing: 5 # 6 # May you do good and not evil. 7 # May you find forgiveness for yourself and forgive others. 8 # May you share freely, never taking more than you give. 9 # 10 #*********************************************************************** 11 # 12 # Test cases for the strftime() SQL function. Comparisons against the 13 # C-library strftime() function. 14 15 set testdir [file dirname $argv0] 16 source $testdir/tester.tcl 17 18 # Skip this whole file if date and time functions are omitted 19 # at compile-time 20 # 21 ifcapable {!datetime} { 22 finish_test 23 return 24 } 25 26 if {$tcl_platform(os)=="Linux"} { 27 if {"" eq [strftime {%P} 1]} { 28 # This is probably musl libc, which does not support 29 # %k, %l, %P 30 set FMT {%d,%e,%F,%H,%I,%j,%m,%M,%u,%w,%W,%Y,%%,%p,%U,%V,%G,%g} 31 } else { 32 set FMT {%d,%e,%F,%H,%k,%I,%l,%j,%m,%M,%u,%w,%W,%Y,%%,%P,%p,%U,%V,%G,%g} 33 } 34 } else { 35 set FMT {%d,%e,%F,%H,%I,%j,%p,%R,%u,%w,%W,%%} 36 } 37 for {set i 0} {$i<=24858} {incr i} { 38 set TS [expr {$i*86390}] 39 do_execsql_test date4-$i { 40 SELECT strftime($::FMT,$::TS,'unixepoch'); 41 } [list [strftime $FMT $TS]] 42 } 43 44 finish_test