Reply To: Puting a zero on to a date

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Puting a zero on to a date Reply To: Puting a zero on to a date

#57035
Charlie Bursell
Participant

    try this

    set dt ”   50307″

    # Adjust date to make it 6 bytes RJZF

    # Note I use “s” here just in case of not all digits

    set dt [format “%06s” [string trimleft $dt]]

    # Assume century of 20

    set century 20

    # If year greater than 50 (or some value) make century 19

    if {[string trimleft [string range $dt 0 1] 0] > 50} {set century 19}

    # Now just append them

    set newdate $century$dt