Reply To: Puting a zero on to a date

Homepage 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

Forum Statistics

Registered Users
5,116
Forums
28
Topics
9,292
Replies
34,432
Topic Tags
286
Empty Topic Tags
10