0

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.

Balayesu Chilakalapudi
  • 1,386
  • 3
  • 19
  • 43
TestUser
  • 33
  • 8

2 Answers2

0

You could use Calendar class to handle localization.

anirudh
  • 4,116
  • 2
  • 20
  • 35
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