File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Date & time operation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Date & time operation" Watch "Date & time operation" New topic

Date & time operation

Mark Leong
Ranch Hand

Joined: Dec 11, 2000
Posts: 60
I have a date and time formatted as follows:-
Date = "2002-02-28"
Time = "14:15:00"
Date is formatted as yyyy-mm-dd and time is hh:mm:ss
How to add/minus X hours from the above date/time?
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 62291

Check out the Calendar and GregorianCalendar classes.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: Date & time operation