• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Date and Time calculations

 
Patil Niteen
Ranch Hand
Posts: 48
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have date and time in IST . How to get the corresponding Date and Time In EST using Java API.



Thanks and regards,
Nitin.
 
Mohamed Sanaulla
Saloon Keeper
Posts: 3165
34
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please check JavaDatesFaq
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15644
48
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have the date in a java.util.Date object?

One thing you should know is that Date objects do not know anything about timezones by themselves. When you convert the Date to a String using a DateFormat object, you can set the TimeZone on the DateFormat object if you want to have it formatted in a certain timezone. For example:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic