Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NetworkedGraphicsMV3500
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Savage
NetworkedGraphicsMV3500
Commits
c577fbee
Commit
c577fbee
authored
3 years ago
by
Brutzman, Don
Browse files
Options
Downloads
Patches
Plain Diff
make calendar local, not static
parent
12b5725e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/edu/nps/moves/dis7/utilities/DisTime.java
+2
-2
2 additions, 2 deletions
src/edu/nps/moves/dis7/utilities/DisTime.java
with
2 additions
and
2 deletions
src/edu/nps/moves/dis7/utilities/DisTime.java
+
2
−
2
View file @
c577fbee
...
@@ -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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment