I am working on a desktop application. It would get input as a text file from user having contents like this :
..................................
..................................
Mon Jul 9 14:41:07 MDT 2012
..................................
..................................
..................................
I am using this information and creating a timeseries chart using jfreechart library. Timezone could be anything available in the world. But when I use this file its default timezone is sytem’s timezone(IST) so doesn’t show MDT time. When I tried to capture timezone from date and then used
TimeZone.setDefault(TimeZone.getTimeZone("MDT"));
It didn’t work. How can I change the default timezone in Java when I am having abbreviation for timezone like MDT, CDT etc?
Thanks Guys. Thanks for quick responses. @vikas your response proves to be more useful. I am using following code and it worked well.
Although there are more than one entries for “MDT” timezone but it resolves my problem without any problem at first match itself. I have tested code on CDT, MDT and CDT timezones and it worked really well.Thanks Guys!!!