Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 9e1105c2a6fef81948d585458d86ebc3839730d7975498e96fe298b97559a931
Ticket: a1bd37b7198f7bf51e8f1f554435045bf6cc8b68
clock (free)scan of ISO 8601 timestamp with literal T behaves strange
User & Date: sebres on 2020-05-25 13:09:30
Changes

  1. comment changed to:
    It looks like clock free scan recognizes literal "T" in (undocumented?) ISO 8601 timestamp incorrectly, I guess as a legacy (military?) timezone "T".
    <pre style="padding-left:10pt">
    # ISO:
    % clock format [clock scan "20200520 14:40:00" -gmt 1] -gmt 1
    Wed May 20 <b style="color:green">14:40:00</b> GMT 2020
    % clock format [clock scan "20200520T14:40:00" -gmt 1] -gmt 1
    Wed May 20 <b style="color:green">14:40:00</b> GMT 2020
    
    # ISO-similar format:
    % clock format [clock scan "2020-05-20 14:40:00" -gmt 1] -gmt 1
    Wed May 20 <b style="color:green">14:40:00</b> GMT 2020
    % clock format [clock scan "2020-05-20T14:40:00" -gmt 1] -gmt 1
    Wed May 20 <b style="color:red">21:40:00</b> GMT 2020
    % clock format [clock scan "2020-05-20 14:40:00  T"    ] -gmt 1
    Wed May 20 <b style="color:red">21:40:00</b> GMT 2020
    </pre>
    This 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). 
    
    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.
    
  2. login: "sebres"
  3. mimetype: "text/plain"