Page 1 of 1

How to add one day to a Timestamp in PX

Posted: Thu Jan 11, 2007 12:54 am
by mattu
Hi Friends,
I want to add/substract one day from a giveg Timestamp in PX. Can you please give some solution/suggestions how to achive this?


Thanks in Advance.

Regards,
Mattu

Posted: Thu Jan 11, 2007 1:30 am
by ray.wurlod
Extract the date, convert to Julian, add 1, convert back to date and re-assemble the timestamp.

Using Julian date

Posted: Thu Jan 11, 2007 1:54 am
by arnabdey
You can use this

StringToTimestamp(DateFromJulianDay((JulianDayFromDate(Left(DSLink3.timstm, 10))+1)):Right(DSLink3.timstm,9))

where DSLink3.timstm is the input timestamp.

Posted: Thu Jan 11, 2007 6:12 am
by ray.wurlod
Only if the source timestamp is a string. What if it's really a timestamp? The OP was unclear on this point, which is why my solution was couched in general terms.

Posted: Thu Jan 11, 2007 8:27 am
by arnabdey
Hi Ray

I had tried this in a job and then posted. It's input format is timestamp only, in the form yyyy-mm-dd hh:mm:ss. Now this format can be set at project level as well as job level.

Thanx