Please note that you can subscribe to the individual forums. A subscription for news only covers the news.
Hi Everyone... I'm trying to figure out how to subtract a time variable. I'm simply looking to subtract a number of hours to determine a bedtime but it just doesn't seem to work. Also, is there a way to not include seconds when having to answer the question or getting a response?
[report-test time variable subtraction]
inputTime!=!waketime,What time will you need to wake up by?
subtract!=!waketime,08:00
message=Be in bed by {!waketime}.
Does anyone know of a way that if I say I need to be up by 6 am it would calculate and display !waketime as 10 pm?
Thanks for any help in advance!
Chazz
Hi Chazz
When you are crossing midnight in a subtraction, you need to have a date part of the time variable. You can simply add the current date. Because you don't use the date part, it doesn't matter which date it is.
{!waketime,t} will show the time of day and ignore the date. I am not sure, but I think it will use am/pm instead of the 24 hour clock if the users computer is set up to that time format.
I don't think you can avoid the seconds.
[report-test time variable subtraction]
inputTime!=!waketime,What time will you need to wake up by?
; add the date
add!=!waketime,!zzdate
subtract!=!waketime,08:00
; Show the time part only
message=Be in bed by {!waketime,t}.
Sven
Excellent!! Thanks so much for all you do Sven!!