Author |
|
mike0999 Groupie
Joined: June 14 2009 Location: United States
Online Status: Offline Posts: 56
|
Posted: June 14 2009 at 04:30 | IP Logged
|
|
|
Hi,
I am new to Powerhome - trying it out during my 30 day trial period. Seems like a great program. Amazing flexibility.
I am trying to create a formula that gives me the time 30 minutes in the future. The relativetime function returns a maximum value of 23:59:59. So, if I use the relativetime command for any time that is 23:30:00 or greater, I get an error.
I have been trying to work my way around this by using an if statement to test if I am later than 23:29:59. I have been trying to use the if statement to subtract 23:30:00 from the now() time if I am later than 23:29:59, but I get an error whenever I try to subtract time values.
Does subtraction not work with time values or am I doing something wrong?
I am sure I can come up with an approach that works, but wanted to ask to confirm whether or not subtraction is supposed to work with time values.
Thanks in advance for any help.
Regards,
Mike
|
Back to Top |
|
|
mike0999 Groupie
Joined: June 14 2009 Location: United States
Online Status: Offline Posts: 56
|
Posted: June 14 2009 at 06:36 | IP Logged
|
|
|
I think this probably does what I want:
if(now() > 23:29:59,relativetime(00:00:00,secondsafter(23:30:00,now())) ,relativetime(now(),1800))
But, still would like to confirm you can't "subtract" times (maybe unless you convert to seconds first)?
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: June 15 2009 at 22:04 | IP Logged
|
|
|
Mike,
Welcome to PowerHome!
Unfortunately, you cant directly add/subtract Time values. You must use one of the relativetime type of functions. However, to obtain a simple time 30 minutes in the future, just use this formula:
Code:
time(ph_relativedatetime(today(),30)) |
|
|
It won't have the problems of going beyond the current day.
HTH,
Dave.
|
Back to Top |
|
|
mike0999 Groupie
Joined: June 14 2009 Location: United States
Online Status: Offline Posts: 56
|
Posted: June 15 2009 at 22:47 | IP Logged
|
|
|
Hey Dave. Thanks a lot!
|
Back to Top |
|
|