# HG changeset patch # User Matti Hamalainen # Date 1633888340 -10800 # Node ID 7897b795480b90499b60920b888dff4eb436bbc2 # Parent de6cab61061fa278b83cd9009afdf93ef8825491 quotedb: Use custon qdb_ctime() instead of utl_ctime() for shorter timestamp. diff -r de6cab61061f -r 7897b795480b quotedb.tcl --- a/quotedb.tcl Thu Jul 15 12:37:58 2021 +0300 +++ b/quotedb.tcl Sun Oct 10 20:52:20 2021 +0300 @@ -69,6 +69,14 @@ } +proc qdb_ctime {ustamp} { + if {$ustamp == "" || $ustamp == "*"} { + set ustamp 0 + } + return [clock format $ustamp -format "%d.%m.%Y"] +} + + proc qdb_sql_exec {ucmd utable upublic unick uchan usql} { global qdb_handle if {[catch {qdb_handle eval $usql} uerrmsg]} { @@ -327,7 +335,7 @@ if {[string range $uquote 0 3] == "img:"} { set uquote "${urlprefix}[string range $uquote 4 end]" } - qdb_msg $ucmd $utable $upublic $unick $uchan "fmt_get" [list $quoteID $uquote $uuser [utl_ctime $utime] $uvote] + qdb_msg $ucmd $utable $upublic $unick $uchan "fmt_get" [list $quoteID $uquote $uuser [qdb_ctime $utime] $uvote] return 1 } @@ -427,7 +435,7 @@ set usql "SELECT id AS quoteID, utime AS utime, utext AS utext, user AS uuser FROM $utable $fquery ORDER BY utime DESC LIMIT $ulimit" qdb_handle eval $usql { incr uresults - qdb_msg $ucmd $utable $upublic $unick $uchan "fmt_search" [list $quoteID $utext $uuser [utl_ctime $utime]] + qdb_msg $ucmd $utable $upublic $unick $uchan "fmt_search" [list $quoteID $utext $uuser [qdb_ctime $utime]] } if {$uresults == 0} {