Originally posted by David Harrison
I need to subtract one minute from the time and date if it is midnight. The datetime is presented as CCYYMMDDHHMM. I found the following code but it only works if there is a space between the date and time:
sset time "20110419 0000"
set format "%Y%m%d%H%M"
set time [clock format [clock scan "-1 minute" -base [clock scan $time]] -format $format]
puts $time
201104182359
If I remove the space I get:
set time "201104190000"
set format "%Y%m%d%H%M"
set time [clock format [clock scan "-1 minute" -base [clock scan $time]] -format $format]
puts $time
7393106182359
Any clues welcome.