In this section, you will learn to convert GMT to EST. The GMT stands for Greenwich Mean Time and EST stands for Eastern Standard Time.
Convert GMT to EST
In this section, you will learn to convert GMT to EST. The GMT stands for
Greenwich Mean Time and EST stands for Eastern Standard
Time.
Description of program:
This example helps you in converting GMT to EST on the console. The SimpleDateFormat() constructor uses the given pattern and date format symbols. Here we use the date format
as gmt and est. And we pass it to the isetTimeZone() method that invokes with SimpleDateFormat object and provides a date in the
EST format.
|
Output of the program:
C:\unique>javac GMTtoEST.java C:\unique>java GMTtoEST GMT Time: 8/4/07 4:49 AM EST Time: 8/3/07 11:49 PM C:\unique> |