This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Java in General and the fly likes Date and Time calculations Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Date and Time calculations" Watch "Date and Time calculations" New topic
Author

Date and Time calculations

Patil Niteen
Ranch Hand

Joined: Dec 10, 2009
Posts: 48

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.


SCJP 1.4, SCWCD 5
Mohamed Sanaulla
Bartender

Joined: Sep 08, 2007
Posts: 2928
    
  15

Please check JavaDatesFaq


Mohamed Sanaulla | My Blog
Jesper de Jong
Java Cowboy
Bartender

Joined: Aug 16, 2005
Posts: 12929
    
    3

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 7 API documentation
Scala Notes - My blog about Scala
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Date and Time calculations
 
Similar Threads
What is the Data Type for GMT Date and Time?
how to convert String into Date format
advanced calculator
Date question
displaying time