I just downloaded Tcl bindings for 3.3.13 and am having trouble with some code that I wrote last year. Here's my code:

load tclsqlite3.dll Sqlite3
sqlite3 db foo.sqb

set q1 "SELECT DATETIME('now','localtime','start of day') today"
db eval $q1 x {
   set today $x(today)
   puts "today = $today"
}

set dq "SELECT DATETIME('$today','localtime','start of day','-1 days') t1,"
append dq " DATETIME('$today','localtime','start of day','+1 days') t3"
db eval $dq x {
   set yesterday [lindex $x(t1) 0]
   set tomorrow [lindex $x(t3) 0]
   puts "yesterday=$yesterday tomorrow=$tomorrow"
}

Running this script, I get this:

today = 2007-03-20 00:00:00
yesterday=2007-03-18 tomorrow=2007-03-20

Seems to be off somehow. This code worked up until the day we in the US switched over to the new timezone rules. I'm running Windows XP/Pro fully patched and ActiveState 8.4.14.0 ...

Is there an easier way to do this?  Maybe this is a bug in Tcl?

---

Nah, I just ran it on (patched) Red Hat in C.  Same result.

Help?

/jordan

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to