How to return modified timezone Date
object in java.
SimpleDateFormat
class only formats and prints the date(in String
) but it never changes the actual Date
object.
Asked
Active
Viewed 46 times
0

Balayesu Chilakalapudi
- 1,386
- 3
- 19
- 43

TestUser
- 33
- 8
-
1Could you provided what you tried with SimpleDateFormat? – sp00m Mar 20 '14 at 11:00
-
Possible duplicate: http://stackoverflow.com/questions/7670355/convert-date-time-for-given-timezone-java – Shishir Kumar Mar 20 '14 at 11:06
2 Answers
0
(a) Be specific. What are you trying to do to the date-time value?
(b) Check out Joda-Time or the new java.time package in Java 8.
You can add or subtract minutes, hours, days, and such.
You can set the time portion to the first moment of the day.
You can set a specific time.
You can adjust to any other time zone.
You can compare if one date-time is before or after another.

Basil Bourque
- 303,325
- 100
- 852
- 1,154