This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Time conversion to IST from EST

 
Balachandran Vijayarajan
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

My database and app. servers are running in US. I need to display a time column in the JSP, both EST and IST time.

My trying to convert the EST time to IST like below
-------------------------------------------------------
String startDateString = "12/23/2005 11:20:00"; (EST)
java.util.Date olddate = new java.util.Date(startDateString);

java.text.SimpleDateFormat simple_date = new java.text.SimpleDateFormat("MM/dd/yyyy HH:mm:ss");

simple_date.setTimeZone(TimeZone.getTimeZone("Asia/Calcutta"));
java.util.Date newdate = new java.util.Date(simple_date.format(olddate));

java.text.DateFormat hrmins = new java.text.SimpleDateFormat("HH:mm");
String finalTime = hrmins.format(newdate);
log.info("Here in Home Meeting Time IST --> "+finalTime);

The result is - 11:20 (IST)

But for me it�s always displaying the same time for both EST and IST.

Is there anything wrong in the above code snippet? If so, please correct me.

Thanks and Regards,

Bala
 
Balachandran Vijayarajan
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry. I have posted wrongly here. Posted in java(inter).Please reply there.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic