Link to home
Start Free TrialLog in
Avatar of apparition
apparition

asked on

Use java.sql.Timestamp

I am calling two functions in an object that recieve a Timestamp. The first function I need to pass current time and the next one i need to pass a date 30 days in the future.
For example :

obj.setStartDate(currentTimeStamp)
obj.setEndDate(futureTimeStamp)

how do i get the values in "currentTimeStamp" and "futureTimeStamp"
ASKER CERTIFIED SOLUTION
Avatar of dberner9
dberner9
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
To create a timestamp that will give you the current time:

new Timestamp(new Date().getTime())
Just FYI, "System.out.println(futureTimeStamp);" isn't necessary for converting the date, just some test code.

Derek