acs_mail_lite::utils::build_date (private)
acs_mail_lite::utils::build_date [ date ]
Defined in packages/acs-mail-lite/tcl/utils-procs.tcl
Depending on the available mime package version, it uses either the mime::parsedatetime to do it or local code (parsedatetime is buggy in mime < 1.5.2 )
- Parameters:
- date (optional)
- A 822-style date-time specification "YYYYMMDD HH:MI:SS"
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: if { $date eq "" } { set clock [clock seconds] set date [clock format $clock -format "%Y-%m-%d %H:%M:%S"] } else { set clock [clock scan $date] } if { [catch {package require mime 1.5.2}] } { set gmt [clock format $clock -format "%Y-%m-%d %H:%M:%S" -gmt true] set diff [expr {($clock - [clock scan $gmt]) / 60}] if {$diff < 0} { set s - set diff [expr {-$diff}] } else { set s + } set zone [format %s%02d%02d $s [expr {$diff/60}] [expr {$diff%60}]] set wdays_short [list Sun Mon Tue Wed Thu Fri Sat] set months_short [list Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec] set wday [lindex $wdays_short [clock format $clock -format %w]] set mon [lindex $months_short [expr {[string trimleft [clock format $clock -format %m] 0] - 1}]] set result [clock format $clock -format "$wday, %d $mon %Y %H:%M:%S $zone"] } else { set result [mime::parsedatetime $date proper] } return $resultXQL Not present: Generic, PostgreSQL, Oracle