mirror of https://github.com/apache/poi.git
improve performance of time zone lookup
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1898125 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9e85169bdf
commit
3f3d194689
|
@ -93,7 +93,7 @@ public class DateUtil {
|
||||||
*/
|
*/
|
||||||
public static LocalDateTime toLocalDateTime(Date date) {
|
public static LocalDateTime toLocalDateTime(Date date) {
|
||||||
return date.toInstant()
|
return date.toInstant()
|
||||||
.atZone(TimeZone.getTimeZone(ZoneOffset.UTC).toZoneId()) // java.util.Date uses UTC
|
.atZone(LocaleUtil.TIMEZONE_UTC.toZoneId()) // java.util.Date uses UTC
|
||||||
.toLocalDateTime();
|
.toLocalDateTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ public class DateUtil {
|
||||||
*/
|
*/
|
||||||
public static LocalDateTime toLocalDateTime(Calendar date) {
|
public static LocalDateTime toLocalDateTime(Calendar date) {
|
||||||
return date.toInstant()
|
return date.toInstant()
|
||||||
.atZone(TimeZone.getTimeZone(ZoneOffset.UTC).toZoneId()) // java.util.Date uses UTC
|
.atZone(LocaleUtil.TIMEZONE_UTC.toZoneId()) // java.util.Date uses UTC
|
||||||
.toLocalDateTime();
|
.toLocalDateTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue