Link to home
Start Free TrialLog in
Avatar of inversojvo
inversojvoFlag for Germany

asked on

Java - Timestamp

Hi,

How can I define timestamp in java?

Could you please give me the right code for the following lines?

Timestamp a as new Timestamp;
a = Current date in the form YYYY-MM-DD HH:MM:SS.MMMMMM (as in DB2)

Timestamp b as new Timestamp;
b = '2009-09-20 08:15:25.000001'
(how can I make the diffence between 08.00 am an 08.00 pm?)

If (b - a < 30 minutes) {
.....
}

Many thanks and have a nice day!
isaf
ASKER CERTIFIED SOLUTION
Avatar of Kevin Cross
Kevin Cross
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
SOLUTION
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
Avatar of inversojvo

ASKER

Many thanks