Posts: 1,058
Threads: 367
Joined: Oct 2007
I wonder whether there exists a simple way to output a DateTime variable in the form hhh:mm
s where hhh the hours part which it may exceed the limit of 23.
I attach herewith my approach
Many thanks in advance.
Macro
temp05
str s6="19:59:00"
str s="08:14:00"
DateTime x sx
x.AddStr(s6)
x.AddStr(s)
int day hour minu sec
x.GetParts(0 0 day hour minu sec)
hour=day*24+hour
outt F"{hour%%04i}:{minu%%02i}:{sec%%02i}"
Posts: 12,095
Threads: 142
Joined: Dec 2002
Probably nothing shorter/better exists.
Posts: 12,095
Threads: 142
Joined: Dec 2002
error if
rep(60) x.AddStr("23:55:55")
TimeSpanGetParts can get total days without month/year.
Macro
Macro2754
str s6="19:59:00"
str s="08:14:00"
DateTime x sx
x.AddStr(s6)
x.AddStr(s)
rep(12*30) x.AddStr("23:55:55") ;;add more than month
int day hour minu sec
DateTime.TimeSpanGetParts(x day hour minu sec)
hour=day*24+hour
outt F"{hour%%04i}:{minu%%02i}:{sec%%02i}"