Math - Addition to a time

Topics related to MLServer 4
mzn
New Member
New Member
Posts: 49
Joined: Wed Dec 25, 2013 7:40 pm
Contact:

Math - Addition to a time

Postby mzn » Mon Mar 21, 2016 12:29 pm

Hi,

I have a time variable called LightOn set to 14:00:00. How can I set it to NewTime=LightOn+5 minutes so that the NewTime variable reads 14:05:00? In other words, the Math function does not allow any addition/subtraction except with real numbers, not dates or times. Is there a workaround?

Thanks in advance.

User avatar
CinemarDave
Site Admin
Site Admin
Posts: 10535
Joined: Fri Feb 07, 2003 8:56 am
Location: Planet Earth
Contact:

Re: Math - Addition to a time

Postby CinemarDave » Tue Mar 22, 2016 7:41 pm

Math doesn't support math on time or date values. Something that will get added in the future. Right now you'd have to do something in script that would convert the time to seconds add in the new seconds and then convert it back to a H:M:S string. Or do all the calculation based on the absolute time of day in seconds where 14:00:00 = 50400 14:05:00 = 50700.


Return to “MLServer 4”

Who is online

Users browsing this forum: No registered users and 1 guest