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
tz_var
secfrac_var (optional)

Partial Call Graph (max 5 caller/called nodes):
%3 test_test_misc_core test_misc_core (test xotcl-core) xo::db::tcl_date xo::db::tcl_date test_test_misc_core->xo::db::tcl_date Class ::xo::ical::VCALITEM Class ::xo::ical::VCALITEM (public) Class ::xo::ical::VCALITEM->xo::db::tcl_date Class ::xowf::test_item::Answer_manager Class ::xowf::test_item::Answer_manager (public) Class ::xowf::test_item::Answer_manager->xo::db::tcl_date Class ::xowf::test_item::Question_manager Class ::xowf::test_item::Question_manager (public) Class ::xowf::test_item::Question_manager->xo::db::tcl_date packages/xowiki/lib/portlets/weblog-mini-calendar.tcl packages/xowiki/ lib/portlets/weblog-mini-calendar.tcl packages/xowiki/lib/portlets/weblog-mini-calendar.tcl->xo::db::tcl_date xo::PackageMgr instproc require_site_wide_pages xo::PackageMgr instproc require_site_wide_pages (public) xo::PackageMgr instproc require_site_wide_pages->xo::db::tcl_date

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 $timestamp
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: