Mercurial > hg > egg-tcls
changeset 683:7897b795480b
quotedb: Use custon qdb_ctime() instead of utl_ctime() for shorter timestamp.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 10 Oct 2021 20:52:20 +0300 |
parents | de6cab61061f |
children | 5163d582e396 |
files | quotedb.tcl |
diffstat | 1 files changed, 10 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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} {