Skip to content

Commit

Permalink
Tidy up timestamp conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
joniles committed Oct 31, 2024
1 parent 0855476 commit 75683b2
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/main/java/net/sf/mpxj/mpp/ProjectPropertiesReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@

import java.io.FileNotFoundException;
import java.time.LocalDateTime;
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;
Expand Down Expand Up @@ -242,9 +242,6 @@ private LocalDateTime getLocalDateTime(Date date)
return null;
}

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));
return LocalDateTime.ofInstant(date.toInstant(), TimeZone.getDefault().toZoneId());
}

private final Calendar m_calendar = Calendar.getInstance();
}

0 comments on commit 75683b2

Please sign in to comment.