| Author |
How to decide EST or EDT in java program
|
trupti nigam
Ranch Hand
Joined: Jun 21, 2001
Posts: 602
|
|
In the code, I am trying to query oracle databse based on date. This date is stored in EST or EDT in Oracle table.
In order to query the DB, I need to convert the incoming date on the request from GMT to EST or EDT format. How can one decide to use what format? (EST or EDT). How can this be achieved in java program.
Thanks
Trupti
|
 |
Afzal Rehman
Ranch Hand
Joined: Dec 16, 2009
Posts: 35
|
|
Hi ,
As you said data stored in EST format.
so First thing you need to convert the data from EST to GMT.
i am trying to give you idea then sorted out yourself whatever you want to achieve
// Create the Date
Date d = new Date();
get that particular date from your database field
DateFormat gmt= new SimpleDateFormat();
TimeZone gmtTime = TimeZone.getTimeZone("GMT");
estFormat.setTimeZone(gmtTime);
gmtFormat.format(date); convert this toString
Then you would have in GMT format.
This is hint may be you can figureout whatever you want to achieve.
Best Regards
|
SCJP 6.0
|
 |
fred rosenberger
lowercase baba
Bartender
Joined: Oct 02, 2003
Posts: 9946
|
|
|
how do you know how it's stored in the database? In other words, what rules were used to store it?
|
Never ascribe to malice that which can be adequately explained by stupidity.
|
 |
 |
|
|
subject: How to decide EST or EDT in java program
|
|
|