Index: openacs-4/packages/xotcl-core/tcl/05-db-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/05-db-procs.tcl,v diff -u -r1.28 -r1.29 --- openacs-4/packages/xotcl-core/tcl/05-db-procs.tcl 14 Jul 2007 18:01:13 -0000 1.28 +++ openacs-4/packages/xotcl-core/tcl/05-db-procs.tcl 29 Jul 2007 20:17:01 -0000 1.29 @@ -382,6 +382,16 @@ } DbPackage create_all_functions + + ad_proc tcl_date {timestamp tz_var} { + Convert the time stamp (coming from the database) into a format, which + can be passed to Tcl's "clock scan". + } { + upvar $tz_var tz + set tz 00 + regexp {^([^.]+)[.][0-9]+(.*)$} $timestamp _ timestamp tz + return $timestamp + } } Index: openacs-4/packages/xowiki/tcl/package-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/package-procs.tcl,v diff -u -r1.75 -r1.76 --- openacs-4/packages/xowiki/tcl/package-procs.tcl 28 Jul 2007 13:01:57 -0000 1.75 +++ openacs-4/packages/xowiki/tcl/package-procs.tcl 29 Jul 2007 20:17:01 -0000 1.76 @@ -744,9 +744,9 @@ if {[string match "::*" $name]} continue if {$content_type eq "::xowiki::PageTemplate::"} continue - regexp {^([^.]+)[.][0-9]+(.*)$} $last_modified _ time tz - + set time [::xo::db::tcl_date $last_modified tz] set time "[clock format [clock scan $time] -format {%Y-%m-%dT%T}]${tz}:00" + append content \n\ [::$package_id pretty_link -absolute true $name] \n\ $time \n\ @@ -783,7 +783,7 @@ "select last_modified from acs_objects where package_id = $package_id \ order by last_modified desc limit 1"] - regexp {^([^.]+)[.][0-9]+(.*)$} $last_modified _ time tz + set time [::xo::db::tcl_date $last_modified tz] set time "[clock format [clock scan $time] -format {%Y-%m-%dT%T}]${tz}:00" #my log "--site_node::get_from_object_id -object_id $package_id" Index: openacs-4/packages/xowiki/tcl/syndicate-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/syndicate-procs.tcl,v diff -u -r1.18 -r1.19 --- openacs-4/packages/xowiki/tcl/syndicate-procs.tcl 29 Jul 2007 19:44:11 -0000 1.18 +++ openacs-4/packages/xowiki/tcl/syndicate-procs.tcl 29 Jul 2007 20:17:01 -0000 1.19 @@ -159,13 +159,13 @@ set description [string trim $description] if {$description eq ""} {set description $body} - regexp {^([^.]+)[.][0-9]+(.*)$} $last_modified _ time tz - + if {$title eq ""} {set title $name} + set time [::xo::db::tcl_date $last_modified tz] set link [::xowiki::Portlet detail_link \ -package_id $package_id -name $name \ -absolute true \ -instance_attributes $instance_attributes] - if {$title eq ""} {set title $name} + #append title " ($content_type)" set time "[clock format [clock scan $time] -format {%a, %d %b %Y %T}] ${tz}00" append content [my item \ @@ -253,11 +253,7 @@ db_foreach get_pages $sql { if {$content_type ne "::xowiki::PodcastItem"} continue - - #regexp {^([^.]+)[.][0-9]+(.*)$} $last_modified _ time tz - if {$title eq ""} {set title $name} - #set time "[clock format [clock scan $time] -format {%a, %d %b %Y %T}] ${tz}00" set link [::$package_id pretty_link -download true -absolute true -siteurl $siteurl $name] append content [my item \ -author $creator -title $title -subtitle $subtitle \ @@ -306,8 +302,8 @@ -orderby "revision_id desc" \ -limit $limit] db_foreach get_pages $sql { - regexp {^([^.]+)[.][0-9]+(.*)$} $publish_date _ publish_date tz - regexp {^([^.]+)[.][0-9]+(.*)$} $creation_date _ creation_date tz + set publish_date [::xo::db::tcl_date $publish_date tz] + set creation_date [::xo::db::tcl_date $creation_date tz] set clock [clock scan $publish_date] if {$last_user == $creation_user && $last_item == $item_id && $last_clock ne ""} { Index: openacs-4/packages/xowiki/tcl/weblog-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/weblog-procs.tcl,v diff -u -r1.18 -r1.19 --- openacs-4/packages/xowiki/tcl/weblog-procs.tcl 29 Jul 2007 11:49:55 -0000 1.18 +++ openacs-4/packages/xowiki/tcl/weblog-procs.tcl 29 Jul 2007 20:17:01 -0000 1.19 @@ -129,8 +129,8 @@ $c instvar revision_id publish_date title name item_id creator creation_user \ description body instance_attributes - regexp {^([^.]+)[.][0-9]+(.*)$} $publish_date _ publish_date tz - set pretty_date [util::age_pretty -timestamp_ansi $publish_date \ + set time [::xo::db::tcl_date $publish_date tz] + set pretty_date [util::age_pretty -timestamp_ansi $time \ -sysdate_ansi [clock_to_ansi [clock seconds]] \ -mode_3_fmt "%d %b %Y, at %X"]