• 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.
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!