Forum OpenACS Development: Re: convert any date string to timestamp w/ or w/o timezone

Dave,

Yes, I tried so. As in:

set date "Wed, 31 Oct 2012 16:03:55 -0200"
set date [clock format [clock scan $date] -format "%D %T"]

However I got a TCL exception on the second line.

Torben,
Thanks for the references!

Anyway, I'll spend more neurons to solve it.

I just remembered that I could make things easier by posting the TCL exception erro message.

I wonder if I store the date as varchar instead of timestamptz would facilitate the work, since I have no idea what formats might appear on future feeds.

What do you guys suggest?

[31/Oct/2012:18:40:44][6204.3050265456][-sched:7-] Notice: DATE {Wed, 31 Oct 2012 18:39:57 +0000}
[31/Oct/2012:18:40:44][6204.3050265456][-sched:7-] Error: Tcl exception:
unable to convert date-time string "Wed, 31 Oct 2012 18:39:57 +0000"
while executing
"clock scan $date"
(procedure "iurix_mail::new" line 29)
invoked from within
"iurix_mail::new -user_id $user_id -largs $largs "
(procedure "::callback::acs_mail_lite::incoming_email::impl::iurix-mail" line 27)
invoked from within
"::callback::acs_mail_lite::incoming_email::impl::iurix-mail -array email"
("uplevel" body line 1)
invoked from within
"::uplevel 1 $procname $args"

Collapse
Posted by Jim Lynch on
Seems you're getting close to what you want; good hunting!