Page 1 of 1

Converting to Seconds

Posted: Tue Jun 12, 2012 12:57 am
by Tester2
The current time is 4:00PM.

I have the time "4:30 PM" in a field called Time.

How can I figure out the difference between these in seconds?

Obviously the current time can be captured (put the seconds into tCurrentTime).

I tried the following:

convert field Time to seconds

put merge (tCurrentTime - field Time) into tNotificationTime

...but this did not work.

Please help soon!

Thanks bunches...

-Tester2

Re: Converting to Seconds

Posted: Tue Jun 12, 2012 1:15 am
by sturgis
time is a reserved word. This is why you should always quote your object names (and avoid using reserved words anyway)

convert field "time" to seconds


Also, merge does a placeholder replacement.

So if you have put merge("The time is now [[the short time]]")

The time is now 4:00 PM

In the case of what you want to do merge isn't really the right tool.

just: put time1 - time2 into field "myTimeField" should work fine.

Re: Converting to Seconds

Posted: Fri Jun 15, 2012 2:30 pm
by CALL-151
Tester2,

Sarah Reichelt developed some comprehensive date and time scripts that you may find to be a valuable resource. They are scattered around the Web, e.g. at http://www.troz.net/rev/index.irev?cate ... ary#stacks and http://support.runrev.com/scriptingconferences/