What is the default timezone for java.util.Calendar.?

后端 未结 4 1007
一整个雨季
一整个雨季 2021-02-09 16:26

Code

public String testDate(){ 
      TimeZone.setDefault(TimeZone.getTimeZone(\"US/Eastern\"));
      Calendar fromDate = Calendar.getInstance(         


        
4条回答
  •  佛祖请我去吃肉
    2021-02-09 17:11

    Typically, you get a TimeZone using getDefault which creates a TimeZone based on the time zone where the program is running. For example, for a program running in Japan, getDefault creates a TimeZone object based on Japanese Standard Time.

    Check TimeZone for more

提交回复
热议问题