Ruang penulis
← Kembali ke jurnal
Core API

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

DWayan · 16 Jun 2010 · 1 menit baca

Artikel oleh Wayan · Sumber: Kode Java ↗

Terjemahan artikel ini belum tersedia. Isi asli ditampilkan.

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
← Jelajahi catatan lainnya