I need some help with date-time conversion. Our servers are setting cookies with local time-stamp i.e., Thu, 09 Apr 2008 17:06:48 PDT (or PST). I am trying to find a way to convert this time-stamp to GMT i.e., Thu, 10 Apr 2008 00:06:48 PDT.
I have tried code like this:
set cookie_expires [HTTP::cookie “Expires”]
set x [clock scan $cookie_expires -format {%a, %d %b %Y %T %Z}]]
set y [clock format $x -format {%a, %d %b %Y %T %Z} -timezone :UTC]
Per the man page for clock (Click here), I don’t think -format is a valid flag for clock scan. And -timezone doesn’t seem to be valid for clock format. Can you give this a shot?
when RULE_INIT {
set ::date_str_orig {Thu, 09 Apr 2008 17:06:48 PDT}
set x [clock scan $::date_str_orig]
set y [clock format $::x -format {%a, %d %b %Y %T %Z} -gmt 1]
log local0. "\$::date_str_orig: $::date_str_orig, \$::x: $::x, \$::y: $::y"
}