How do I get Host Default Time Zone ID?

package org.kodejava.util;

import java.util.TimeZone;

public class HostDefaultTimeZone {
    public static void main(String[] args) {
        // Gets the default TimeZone ID for this host
        String id = TimeZone.getDefault().getID();
        System.out.println("Default Time Zone ID: " + id);
    }
}

The default timezone id for this host is:

Default Time Zone ID: Asia/Shanghai
Wayan

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.