3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
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.
10 #***********************************************************************
12 # Test cases for the strftime() SQL function. Comparisons against the
13 # C-library strftime() function.
15 set testdir [file dirname $argv0]
16 source $testdir/tester.tcl
18 # Skip this whole file if date and time functions are omitted
21 ifcapable {!datetime} {
26 if {$tcl_platform(os)=="Linux"} {
27 set FMT {%d,%e,%F,%H,%k,%I,%l,%j,%m,%M,%u,%w,%W,%Y,%%,%P,%p}
29 set FMT {%d,%e,%F,%H,%I,%j,%p,%R,%u,%w,%W,%%}
31 for {set i 0} {$i<=24854} {incr i} {
32 set TS [expr {$i*86401}]
33 do_execsql_test date4-$i {
34 SELECT strftime($::FMT,$::TS,'unixepoch');
35 } [list [strftime $FMT $TS]]