- This topic has 11 replies, 6 voices, and was last updated 11 years, 10 months ago by .
-
Topic
-
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:
Code: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 $time201104182359
If I remove the space I get:
Code: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 $time7393106182359
Any clues welcome.
Viewing 10 reply threads
Viewing 10 reply threads
- The forum ‘Cloverleaf’ is closed to new topics and replies.