XML DateTime format

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf XML DateTime format

  • Creator
    Topic
  • #48819
    Bill May
    Participant

      Dear All,

      I have a requirement to map from the HL7 TS type to an XML DateTime format

      The XML DateTime format is

      Complete date plus hours and minutes:

           YYYY-MM-DDThh:mmTZD (eg 1997-07-16T19:20+01:00)

      I have coded some tcl to handle all but the TZD part

      Any ideas on accessing the TZD via tcl

      I’m running on windows

      Thanks,

      Bill

    Viewing 0 reply threads
    • Author
      Replies
      • #59799
        Charlie Bursell
        Participant

          All but the GMT offset is easy.  If you already have it use it.

          Assuming I have an HL7 with a full date/time like:

          set dt 20051130133330.0000-0600

          set dateTime [string range $dt 0 13]

          set gmt [string range $dt end-4 end]

          # Make scanable

          regsub — {^(d{8})(d*$)} $dateTime {1 2} dateTime

          set xmlTime [clock format [clock scan $dateTime]

                          -format “%Y-%m-%dT%H%M%S$gmt”]

          => 2005-11-30T133330-0600

          If not given GMT offset and assuming you always use offset relative to your local time you can set it to a constant

      Viewing 0 reply threads
      • The forum ‘Cloverleaf’ is closed to new topics and replies.