In this section, you will learn to convert a GMT to PST format. The GMT stands for Greenwich Mean
Time and PST stands for Pacific Standard Time.
Description of program:
This example helps you in converting a GMT time to PST time on the console. The SimpleDateFormat() constructor uses the given pattern and date format symbols. Here we use the date format as gmtFormat which gets converted to pstFormat. Then we have used getTimeZone() method to get the time of both the zones to be converted.
Pacific Standard Time (PST) = GMT-8
Pacific Daylight Time (PDT) = GMT-7
Here is the code of program:
Output of the program:
GMT Time: 8/4/07 9:54 AM
PST Time: 8/4/07 2:54 AM
Rs. 20,000 US$ 300
Today: Rs. 10,000 US$150
Course Duration: 30 hrs
Posted on: December 15, 2008 If you enjoyed this post then why not add us on Google+? Add us to your Circles