Skip to content
Tcl Source Code View Ticket
Login

View Ticket

clock scan fails with +hhmm time zone

Closed / Wont Fix743698ffffffffffffffffffffffffffffffffffCreated 24 years agoUpdated 22 years ago
Descriptionplain2003-05-26 14:45:40
In Tcl8.4.3, clock scan can parse negative timezone 
offsets but not positive offsets

% clock scan "Mon, 26 May 2003 15:39:42 +0100"
unable to convert date-time string "Mon, 26 May 2003 
15:39:42 +0100"
% clock scan "Mon, 26 May 2003 15:39:42 -0100"
1053967182

[Note: This makes it difficult to use TCLLib's mime::
parsedatetime because it internally uses clock scan]
cleverlyplain2003-05-27 12:28:31
Logged In: YES 
user_id=22080

[clock scan "Sun, 25 May 2003 22:55:54 +0100"] works in Tcl
7.5 up through & including Tcl 8.3.0 beta 1, but fails
beginning with Tcl 8.3.0 beta 2 and onward.
nobodyplain2004-07-09 03:21:38
Logged In: NO 

It does work if there are parentheses around the +hhmm indication:

  % clock scan "Thu, 1 Jan 2004 19:54:32 (+0100)"
  1073004872

Admittedly, this is not a very common time format, but perhaps the
observation can help with the debugging.
kennykbplain2004-08-19 20:51:43
Logged In: YES 
user_id=99768

In 8.5, the current usage of [clock scan] is deprecated
in favour of doing [clock scan] with a -format group that
specifies the expected format of the time.

I plan within the next few weeks to commit code to
tcllib that uses the new [clock scan] (if on at least 8.5)
to convert RFC2822 date/time strings.

The bug is nearly unfixable in the 8.4 code, so I'm
afraid that a fix will have to await 8.5; sorry!
Log in (anonymous is fine) to add a comment.