Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.util.Calendar;
import java.util.TimeZone;

public class Main {

    public static void main(String[] args) {
        Calendar calTokyo = Calendar.getInstance();

        calTokyo.setTimeZone(TimeZone.getTimeZone("Asia/Tokyo"));

        System.out.println(
                "Time in Tokyo: " + calTokyo.get(Calendar.HOUR_OF_DAY) + ":" + calTokyo.get(Calendar.MINUTE));
    }
}
//Time in Tokyo: 1:51