Win a copy of Murach's Java Programming this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Date and Time calculations  RSS feed

 
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
Bartender
Posts: 3174
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
Sheriff
Posts: 15985
86
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:
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!