xo::db::tcl_date (public)
xo::db::tcl_date timestamp tz_var [ secfrac_var ]
Defined in packages/xotcl-core/tcl/05-db-procs.tcl
Convert the timestamp (coming from the database) into a format, which can be passed to Tcl's "clock scan".
- Parameters:
- timestamp (required)
- tz_var (required)
- secfrac_var (optional)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- test_misc_core
Source code: upvar $tz_var tz if {$secfrac_var ne ""} { upvar $secfrac_var secfrac } set tz 00 set secfrac 0 # Oracle style format like 2008-08-25 (no TZ, no sec frac) if {![regexp {^([0-9]+-[0-9]+-[0-9]+)$} $timestamp _ timestamp]} { # PostgreSQL type ANSI format secfrac and TZ if {![regexp {^([^.]+)[.]([0-9]*)([+-][0-9]*)$} $timestamp _ timestamp secfrac tz]} { # no TZ if {![regexp {^([^.]+)[.]([0-9]+)$} $timestamp _ timestamp secfrac]} { regexp {^([^.]+)([+-][0-9]*)$} $timestamp _ timestamp tz } } } return $timestampXQL Not present: Generic, PostgreSQL, Oracle