Skip to content

Commit

Permalink
Make DateTimeFormatter static
Browse files Browse the repository at this point in the history
Signed-off-by: Wouter Born <github@maindrain.net>
  • Loading branch information
wborn committed Jan 9, 2024
1 parent e3c2297 commit e472c74
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class BlinkAccount {
public Account account;
public Auth auth;
public Instant lastTokenRefresh;
public DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE_TIME
public static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ISO_LOCAL_DATE_TIME
.withZone(ZoneId.from(ZoneOffset.UTC));

public static class Auth {
Expand Down Expand Up @@ -69,7 +69,7 @@ public Map<String, String> toAccountProperties() {
props.put(PROPERTY_CLIENT_ID, Long.toString(account.client_id));
props.put(PROPERTY_TIER, account.tier);
props.put(PROPERTY_TOKEN, auth.token);
props.put(PROPERTY_LAST_TOKEN_REFRESH, dateTimeFormatter.format(lastTokenRefresh));
props.put(PROPERTY_LAST_TOKEN_REFRESH, DATE_TIME_FORMATTER.format(lastTokenRefresh));
return props;
}
}

0 comments on commit e472c74

Please sign in to comment.