Skip to content
Snippets Groups Projects
Commit c577fbee authored by Brutzman, Don's avatar Brutzman, Don
Browse files

make calendar local, not static

parent 12b5725e
No related branches found
No related tags found
No related merge requests found
...@@ -162,8 +162,6 @@ public class DisTime ...@@ -162,8 +162,6 @@ public class DisTime
/** Ability to create new PDUs */ /** Ability to create new PDUs */
private static PduFactory pduFactory = new PduFactory(TIMESTAMP_STYLE_DEFAULT); private static PduFactory pduFactory = new PduFactory(TIMESTAMP_STYLE_DEFAULT);
/** calendar instance */
private static GregorianCalendar calendar = new GregorianCalendar();
// private LocalDateTime todayDateTime = new LocalDateTime(); // private LocalDateTime todayDateTime = new LocalDateTime();
// private Instant todayInstant = new Instant(); // private Instant todayInstant = new Instant();
...@@ -227,6 +225,7 @@ public class DisTime ...@@ -227,6 +225,7 @@ public class DisTime
private static synchronized int getCurrentDisTimeUnitsSinceTopOfHour() private static synchronized int getCurrentDisTimeUnitsSinceTopOfHour()
{ {
// set calendar object to current time // set calendar object to current time
GregorianCalendar calendar = new GregorianCalendar();
long currentTime = System.currentTimeMillis(); // UTC milliseconds since 1970 long currentTime = System.currentTimeMillis(); // UTC milliseconds since 1970
calendar.setTimeInMillis(currentTime); calendar.setTimeInMillis(currentTime);
...@@ -326,6 +325,7 @@ public class DisTime ...@@ -326,6 +325,7 @@ public class DisTime
private static synchronized int getCurrentYearTimestamp() private static synchronized int getCurrentYearTimestamp()
{ {
// set calendar object to current time // set calendar object to current time
GregorianCalendar calendar = new GregorianCalendar();
long currentTime = System.currentTimeMillis(); // UTC milliseconds since 1970 long currentTime = System.currentTimeMillis(); // UTC milliseconds since 1970
calendar.setTimeInMillis(currentTime); calendar.setTimeInMillis(currentTime);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment