I define a User Variables Activity and wanted to make 4 parameter base on the system datetime - 1 hour
year int
month int
day int
hour int
Is there any function i can use ?
How to get last hour from System time at Sequence?
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 5
- Joined: Tue Sep 08, 2009 8:45 pm
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Not one function, but you can build it up from more than one, including Date() or @DATE (date in internal format), Time() or @TIME (time in internal format) and doing the time arithmetic for the one hour offset. You could do all that in a server routine, too.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 5
- Joined: Tue Sep 08, 2009 8:45 pm
-
- Participant
- Posts: 5
- Joined: Tue Sep 08, 2009 8:45 pm
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
However Time() - 3600 is correct. If that result is negative you have to subtract 1 from the date.
Code: Select all
If @TIME < 3600 Then Oconv(@DATE - 1, "D-YMD[4,2,2]") : " " : Oconv(@TIME + 86400 - 3600, "MTS") ElseOconv(@DATE, "D-YMD{4,2,2]") : " " : Oconv(@TIME - 3600, "MTS")
Last edited by ray.wurlod on Tue Feb 15, 2011 4:03 am, edited 1 time in total.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 5
- Joined: Tue Sep 08, 2009 8:45 pm