How to make Date locale-independent?

后端 未结 5 1876
我在风中等你
我在风中等你 2021-01-06 10:13

I have a db, that stores dates in OleDateTime format, in GMT timezone. I\'ve implemented a class, extending Date in java to represent that in class

5条回答
  •  情话喂你
    2021-01-06 10:37

    Use a Calendar object:

    Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT"),
                                        locale);
    

提交回复
热议问题