Meaningless Drivel is fun!
The moose likes Java in General and the fly likes Date and Time calculations Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Date and Time calculations" Watch "Date and Time calculations" New topic

Date and Time calculations

Patil Niteen
Ranch Hand

Joined: Dec 10, 2009
Posts: 48


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

Thanks and regards,

Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3151

Please check JavaDatesFaq

Mohamed Sanaulla | My Blog
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15045

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:

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
I agree. Here's the link:
subject: Date and Time calculations
It's not a secret anymore!