From 08554767425d7d87379734c6b3ea6c07fb93553f Mon Sep 17 00:00:00 2001 From: joniles Date: Thu, 31 Oct 2024 18:20:31 +0000 Subject: [PATCH] Revert "Tidy up timestamp conversion" This reverts commit ec22d0cc5ca54a5e1d311aae26fdb3db6c015925. --- .idea/runConfigurations/ProjectExplorer.xml | 20 +++++++++++++++++++ .../sf/mpxj/mpp/ProjectPropertiesReader.java | 6 ++++-- 2 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 .idea/runConfigurations/ProjectExplorer.xml diff --git a/.idea/runConfigurations/ProjectExplorer.xml b/.idea/runConfigurations/ProjectExplorer.xml new file mode 100644 index 0000000000..1bc63de00b --- /dev/null +++ b/.idea/runConfigurations/ProjectExplorer.xml @@ -0,0 +1,20 @@ + + + + \ No newline at end of file diff --git a/src/main/java/net/sf/mpxj/mpp/ProjectPropertiesReader.java b/src/main/java/net/sf/mpxj/mpp/ProjectPropertiesReader.java index 9d46cdb781..b834c6fa75 100644 --- a/src/main/java/net/sf/mpxj/mpp/ProjectPropertiesReader.java +++ b/src/main/java/net/sf/mpxj/mpp/ProjectPropertiesReader.java @@ -28,7 +28,6 @@ import java.util.Calendar; import java.util.Date; import java.util.Map; -import java.util.TimeZone; import java.util.TreeMap; import net.sf.mpxj.common.DayOfWeekHelper; @@ -243,6 +242,9 @@ private LocalDateTime getLocalDateTime(Date date) return null; } - return LocalDateTime.ofInstant(date.toInstant(), TimeZone.getDefault().toZoneId()); + m_calendar.setTime(date); + return LocalDateTime.of(m_calendar.get(Calendar.YEAR), m_calendar.get(Calendar.MONTH) + 1, m_calendar.get(Calendar.DAY_OF_MONTH), m_calendar.get(Calendar.HOUR_OF_DAY), m_calendar.get(Calendar.MINUTE), m_calendar.get(Calendar.SECOND)); } + + private final Calendar m_calendar = Calendar.getInstance(); }