|
2026-10-22
| ||
| 17:19 | • Ticket [a1bd37b719] clock (free)scan of ISO 8601 timestamp with literal T behave... artifact: bb711eb0ea user: serhiy.storchaka | |
|
2026-10-21
| ||
| 10:03 | • Closed ticket [a1bd37b719]. artifact: e0e444d942 user: serhiy.storchaka | |
|
2020-12-30
| ||
| 01:45 | • New ticket [e7eb94e8d1] ambiguous hashes, typo in changes. artifact: 3f7b024dd1 user: chrstphrchvz | |
|
2020-07-09
| ||
| 07:21 | Fix [a1bd37b719]: clock (free)scan of ISO 8601 timestamp with literal T behaves strange check-in: 858e370f1a user: jan.nijtmans tags: core-8-6-branch | |
|
2020-07-08
| ||
| 15:55 | • Ticket [a1bd37b719] clock (free)scan of ISO 8601 timestamp with literal T behave... artifact: e3b56c8573 user: sebres | |
| 14:46 | • Ticket [a1bd37b719]: 3 changes artifact: eb7d2591d8 user: jan.nijtmans | |
|
2020-06-23
| ||
| 06:38 | • Ticket [a1bd37b719]: 3 changes artifact: 85cee713b0 user: jan.nijtmans | |
|
2020-06-22
| ||
| 18:52 | • Ticket [a1bd37b719]: 3 changes artifact: b28b7cd5fa user: sebres | |
| 18:29 | Merge branch 'iso-TZ-bug-21': closes gh-21 (bug [a1bd37b719], https://github.com/sebres/tclclockmod/... check-in: 4f064d306d user: sebres tags: sebres-8-6-clock-speedup-cr2 | |
|
2020-05-27
| ||
| 16:04 | • Add attachment clock-iso-2.patch to ticket [a1bd37b7198f7bf5|a1bd37b719... artifact: 92e8bf60db user: chw | |
| 16:03 | • Ticket [a1bd37b719] clock (free)scan of ISO 8601 timestamp with literal T behave... artifact: d1825ae5a4 user: chw | |
| 15:38 | • Ticket [a1bd37b719]: 3 changes artifact: ee711f697a user: sebres | |
| 14:01 | • Ticket [a1bd37b719]: 3 changes artifact: 75de9ff29b user: jan.nijtmans | |
| 13:58 | Proposed soution for [a1bd37b719]: clock (free)scan of ISO 8601 timestamp with literal T behaves str... check-in: f0ea6d62c1 user: jan.nijtmans tags: bug-a1bd37b719 | |
| 09:34 | • Add attachment clock-iso.patch to ticket [a1bd37b719] artifact: a7b62931a6 user: chw | |
| 09:34 | • Ticket [a1bd37b719] clock (free)scan of ISO 8601 timestamp with literal T behave... artifact: 9ce434ca30 user: chw | |
|
2020-05-26
| ||
| 06:25 | • Ticket [a1bd37b719]: 4 changes artifact: 516a6556bc user: oehhar | |
|
2020-05-25
| ||
| 13:09 | • Ticket [a1bd37b719]: 3 changes artifact: 9e1105c2a6 user: sebres | |
| 10:11 | • Ticket [a1bd37b719]: 3 changes artifact: e0cc106235 user: sebres | |
|
2020-05-21
| ||
| 11:18 | • Ticket [a1bd37b719]: 3 changes artifact: c92487b5e2 user: chw | |
|
2020-05-20
| ||
| 13:17 | • Ticket [a1bd37b719]: 3 changes artifact: fbb95ad5e8 user: sebres | |
| 13:17 | • New ticket [a1bd37b719]. artifact: c48a5836f8 user: sebres | |
clock (free)scan of ISO 8601 timestamp with literal T behaves strange
# ISO: % clock format [clock scan "20200520 14:40:00" -gmt 1] -gmt 1 Wed May 20 14:40:00 GMT 2020 % clock format [clock scan "20200520T14:40:00" -gmt 1] -gmt 1 Wed May 20 14:40:00 GMT 2020This seems not correct in my opinion (despite the documentation says about literal "T" by ISO without "-" separator in date only, recognize "T" as timezone looks weird to me).# ISO-similar format: % clock format [clock scan "2020-05-20 14:40:00" -gmt 1] -gmt 1 Wed May 20 14:40:00 GMT 2020 % clock format [clock scan "2020-05-20T14:40:00" -gmt 1] -gmt 1 Wed May 20 21:40:00 GMT 2020 % clock format [clock scan "2020-05-20 14:40:00 T" ] -gmt 1 Wed May 20 21:40:00 GMT 2020
I think either we must aggressively strict the timezones bison/yacc rules (must consider word boundaries or something similar) or ISO format must be extended with YYYY-MM-DD date.
3f7b024dd1New ticket [e7eb94e8d1] ambiguous hashes, typo in changes. ticket2020-12-30 01:45:52858e370f1aFix [a1bd37b719]: clock (free)scan of ISO 8601 timestamp with literal T behaves strange check-in2020-07-09 07:21:104f064d306dMerge branch 'iso-TZ-bug-21': closes gh-21 (bug [a1bd37b719], https://github.com/sebres/tclclockmod/issues/21) check-in2020-06-22 18:29:44f0ea6d62c1Proposed soution for [a1bd37b719]: clock (free)scan of ISO 8601 timestamp with literal T behaves strange (I like it!) check-in2020-05-27 13:58:09
Citing the "FREE FORM SCAN" section in clock(n) from core-8-6-branch
ISO 8601 point-in-time
An ISO 8601 point-in-time specification, such as “CCyymmddThh‐
mmss,” where T is the literal “T”, “CCyymmdd hhmmss”, or “CCyym‐
mddThh:mm:ss”. Note that only these three formats are accepted.
The command does not accept the full range of point-in-time
specifications specified in ISO8601. Other formats can be rec‐
ognized by giving an explicit -format option to the clock scan
command.
it seems to be some undefined behavior you're observing here regarding
the presence of the -gmt option.
> Citing the "FREE FORM SCAN" section in clock(n) from core-8-6-branch
What you're trying to tell me with?
I wrote already that despite it is documented, one can not say that the behavior by format "YYYY-MM-DDThh:mm:ss" (that is also described as part of ISO 8601) is correct.
There are only two possibility as I suggested above, either to accept it as ISO (to extend the format), or to restrict TZ recognition rules (like word boundaries), so scan would reject it as invalid input.
> it seems to be some undefined behavior you're observing here regarding the presence of the -gmt option.
No, gmt option is only to illustrate that normally no TZ conversions are used by format and scan (and it is ignored if TZ specified in input string). And it has basically nothing with this bug. As already said the free scan considering T literal as a military time zone.
Sebres, Christian, thank you for constantly caring about TCL.
I can say that the format "2020-05-20T14:40:00" is a format I have often to deal with, as some SQL servers return this format for timestamps. I always scanned it with a detailed pattern and I am happy that there is a native support.
I would call it a bug, when the T is interpreted as a time zone indicator and not as the fix ISO separator.
Thank you, Harald
sebres, you're right. What about adding a 4th free scan format CCyy-mm-ddThh:mm:ss like in the attached patch against core-8-6-branch?
Proposed fix committed in a branch here: [f0ea6d62c12fcc40].
With test-case and documentation, what more do we want... I like it!
Well, in-between I found basically more things there, that must be fixed now:
- mistakenly recognizing of other literals (not T only) between digits inside of some digits groups (without space or word-boundaries); also other timezones (like MST/WAST) have 7 as GMT offset, so then will be wrong considered as ISO in this case.
- parsing of integer (in lexer) as tNUMBER or tISOBASE is not restricted by the max length, so it can overflow to "valid" integer (and so can cause "correct" parse by totally incorrect string input), etc pp;
- missing tests covering failing conversion for both above mentioned cases;
- yacc/bison conflicts affected by issue must be reduced;
I'll try to rebase the patch to tcl-core, if I'd get it ready there.
Or alternatively, use my variant which deals with "T" vs other +7 timezones by numerically classifying military tz names vs others in the second attachment, which is a patch relative to bug-a1bd37b719 branch.
I rebased my tclclockmod with fix for that [4f064d306d] to the tcl-core.
I'll try to provide a fix (cherry-pick that) for 8.6 branch.
@Jan: by rebase I noticed that several changes, you've made at some point directly in "tclDate.c", are inconsistent with current "tclGetDate.y" (and so will be lost if you rebuilt it with yacc/bison, e. g. using make gendate).
I guess they must be back-ported to .y-file.
> by rebase I noticed that several changes, you've made at some point directly in "tclDate.c", are inconsistent with current "tclGetDate.y" Indeed, Thanks! I think I corrected that now.
I would like to see this fix in Tcl 8.6.11. Any objections? Otherwise I'll do the merge in a few days!
@sebres, if you have additional suggestions, don't wait too long. I like chw's solution.
Sure, I think to have a better solution, but since it is based on my newest improved branch, this were a bit "larger" change (but as already said - better)...
I'm still unsure about the fix using a cherry-pick from clock-speedup branch, because that would also imply several things (e. g. pre-requirements for positive time zone fix [5019748c73], etc). Surely I was also planning to prepare clock-speedup to merge it at some point (I still hope to fulfill that), but not yet now, since as discussed in tclchat, TCT (Kevin) waiting for a description about all the changes. But such partial cherry-pick could indeed have some pros for me (for instance free-scan would have few conflicts by scanning as well as few differences to speedup-branch in code hereafter).
So if I'd not provide my variant this week, feel free to merge Christian's solution.
Fixed in 8.6.11 by [858e370f1a]: free-form clock scan now accepts and documents CCyy-mm-ddThh:mm:ss, so the T is no longer taken as a military time zone.