Selasa, 27 Juli 2021

How to Convert Local Time to GMT in Java - Example Tutorial

Converting local time into GMT or any other timezone in Java is easy as Java has support for time zones. JDK has a class called java.util.Timezone which represents timezone and Java also has classes like SimpleDateFormat which can use Time zone while parsing or formatting dates. By using java.uti.TimeZone and java.text.SimpleDateFormat we can write a simple Java program to convert local time to GMT or any other time zone in Java. We have already seen examples of How to get current date and time in GMT and this Java program is an extension of that in order to convert time form one timezone to other timezones.

Lorem ipsum is simply dummy text of the printing and typesetting industry.

Comments


EmoticonEmoticon