Skip to content

Commit

Permalink
Merge pull request #520 from CMSgov/QPPCT-562
Browse files Browse the repository at this point in the history
Use US/Eastern time instead of UTC
  • Loading branch information
Adam Harrison committed Dec 22, 2017
2 parents b4d2ce9 + eb4a2a8 commit 2288ad9
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.time.Clock;
import java.time.LocalDate;
import java.time.ZoneId;

import com.google.common.base.Strings;

Expand All @@ -24,8 +25,8 @@ public class CpcClinicalDocumentValidator extends NodeValidator {
static final String END_DATE_VARIABLE = "CPC_END_DATE";
private static final String NEVER_ENDING = "3000-01-01";
// LocalDate.now() creates extra unneeded clock objects before Java 9.
// It also uses the system clock, rather than UTC.
private static final Clock CLOCK = Clock.systemUTC();
// It also uses the system clock, rather than Eastern Time.
private static final Clock CLOCK = Clock.system(ZoneId.of("US/Eastern"));

/**
* Validates a single clinical document node
Expand Down Expand Up @@ -80,7 +81,7 @@ private void validateSubmissionDate(Node node) {
}

/**
* @return the current local date, in UTC
* @return the current local date, in Eastern Time
*/
private LocalDate now() {
return LocalDate.now(CLOCK);
Expand Down

0 comments on commit 2288ad9

Please sign in to comment.