Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;

public class Main {
    public static void main(String[] args) throws Exception {
        String dStr = "Wed, 05 Jun 2015 00:48:12 GMT";
        SimpleDateFormat ft = new SimpleDateFormat("E, dd MMM yyyy HH:mm:ss z");
        Date t = ft.parse(dStr);
        TimeZone gmt = TimeZone.getTimeZone("England/London");
        ft.setTimeZone(gmt);
        System.out.println(t);
        System.out.println(ft.format(t));
    }
}