Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
What is the best way to add 1 hour to a date, both by script and formula ?
i.e.
Current Date
12/10/2010 11:57:31
New Date
12/10/2010 12:57:31
Thanks
Hello.
You can create a variable representing 1 hour (ie. 1/24): set v1hour = .04167. This variable can then be used in the load script or as a formula.
For example, to create a field in the load script representing the current timestamp plus one hour:
timestamp(now() + $(v1hour)) as Curr_TS_Plus_1hour
John.
Sorry I mean to say minus an hour,
Current Date
12/10/2010 11:57:31
New Date
12/10/2010 10:57:31
I tried what you said timestamp(now() - $(v1hour)) as Curr_TS_Plus_1hour but was not working.
Hello.
It should work. See the attached application. For greater precision I set v1hour to .04166667.
Hi John,
I have added your script but for me I have a date of 04/10/2010 11:41:00 but it is returning as 04/10/2010 10:10:00 where it should be 04/10/2010 10:41:00
Is there anyway you can hardcode the above date (04/10/2010 11:41:00) and see what results you are getting now?
Thanks
Hi, and something like this??
timestamp(yourfield - maketime(1))
rgds
Hi Ivan.
Can you please attach a sample application demonstrating the issue. Thanks.
This now works Hector! Thanks