i want to add hours to timestamp .
Moderators: chulett, rschirm, roy
i want to add hours to timestamp .
Hi
i want to add hours to timestamp . is it possible in Parallel Extender 7.5
Sanjay
i want to add hours to timestamp . is it possible in Parallel Extender 7.5
Sanjay
Code: Select all
TimeFromMidnightSeconds(((HoursFromTime([input time]) * 3600) + (MinutesFromTime([input time]) * 60) + SecondsFromTime([input time])) + [hours * 3600])
adding hour to timestamp (Urgent Help Required)b
i am finding difficult in adding hour to timestamp field for in Parallel extender . my
timestamp field : '2004-10-28 10:22:33' want add 10 hours to the field . can anyone help me . i want to do it in PX
sanjay
timestamp field : '2004-10-28 10:22:33' want add 10 hours to the field . can anyone help me . i want to do it in PX
sanjay
T42 wrote:This will work for "Time" field. Have fun with the "Timestamp" version.Code: Select all
TimeFromMidnightSeconds(((HoursFromTime([input time]) * 3600) + (MinutesFromTime([input time]) * 60) + SecondsFromTime([input time])) + [hours * 3600])
-
- Participant
- Posts: 22
- Joined: Thu Jul 29, 2004 8:10 am
Lets say your input is DateIn = '2004-10-28 10:22:33'
Following are the stage variables used:
SDate : Field(DateIn," ",1)
STime : Field(DateIn," ",2)
SHours: 10
SAddTime: TimeFromMidnightSeconds(((HoursFromTime(STime) * 3600) + (MinutesFromTime(STime) * 60) + SecondsFromTime(STime)) + (SHours * 3600))
Output:
SDate : " " : SAddTime
Result : 2004-10-28 20:22:33
Its the same solution given by T42 in explanatory steps
Following are the stage variables used:
SDate : Field(DateIn," ",1)
STime : Field(DateIn," ",2)
SHours: 10
SAddTime: TimeFromMidnightSeconds(((HoursFromTime(STime) * 3600) + (MinutesFromTime(STime) * 60) + SecondsFromTime(STime)) + (SHours * 3600))
Output:
SDate : " " : SAddTime
Result : 2004-10-28 20:22:33
Its the same solution given by T42 in explanatory steps
-
- Participant
- Posts: 108
- Joined: Wed Jul 28, 2004 7:15 am
Regarding adding hourse to timestamp
hi ahmediftikhar
thanks
but how the date will increase because u are just concatenating.
Sanjay
thanks
but how the date will increase because u are just concatenating.
Sanjay
Prashantoncyber wrote:How you going to increase the date if after adding the hours , date gets incremented?
-
- Participant
- Posts: 22
- Joined: Thu Jul 29, 2004 8:10 am
Regarding adding hour to timestamp
Thanks ahmed u have made my task simple
but one clarification required
regarding
SAddTime : TimeFromMidnightSeconds(((HoursFromTime(STime) * 3600) + (MinutesFromTime(STime) * 60) + SecondsFromTime(STime)) + (SHours * 3600))
above function
suppose time : 16:00:00
if u are adding 10 hrs will it make it 06:00:00
Regards
Sanjay
but one clarification required
regarding
SAddTime : TimeFromMidnightSeconds(((HoursFromTime(STime) * 3600) + (MinutesFromTime(STime) * 60) + SecondsFromTime(STime)) + (SHours * 3600))
above function
suppose time : 16:00:00
if u are adding 10 hrs will it make it 06:00:00
Regards
Sanjay
ahmediftikhar wrote:Its very simple add two more stage variable
SAddHours: HoursFromTime(STime) + SHours
SAddDate : If SAddHours > 23 Then DateFromDaysSince(Div(SAddHours,24),SDate) Else SDate
Output is SAddDate : " " : SAddTime
Hope this helps
Ahmed.
-
- Participant
- Posts: 22
- Joined: Thu Jul 29, 2004 8:10 am