Reply To: datetime regexpression help

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf datetime regexpression help Reply To: datetime regexpression help

#59583
Charlie Bursell
Participant

    I assume the string is really   20060831120000.  When dealing with dates I would recommend you always use the clock command.

    First you need your date in a format you can scan which means a space between date and time

    set dt 20060831120000

    regsub — {(d{8})(d+)} $dt {1 2} dt

    echo [clock format [clock scan $dt -format “%m/%d/%Y, %H%M Hours”]

    ==> 08/31/2006, 1200 Hours

    Adjust the format as needed