Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

To get previous day timestamp of a timestamp value in java

807591May 9 2008 — edited May 12 2008
Hi,

I have a timestamp variable, say settledTimeStamp which is passed as a runtime argument to a query. I should also send another timestamp variable say previousTimeStamp whose value should be previous day timestamp, ie for settledTimeStamp.

For example,

Todays date= May 9th 2008.

say settledTimeStamp to May 7th 2008.
I should get the timestamp value for previous day to SettleDate i.e May 6th, 2008.

I am showing this as an example because I tried with Calendar options too but it takes current timestamp and gives previous days timestamp which is not the same as I required. Like it returns May 8th as my previousTimeStamp if I work with Calendar options....

Can anyone help me on this?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 9 2008
Added on May 9 2008
10 comments
2,726 views