Skip to content

Commit

Permalink
Platform agnostic getIssuedAt (#34)
Browse files Browse the repository at this point in the history
Signed-off-by: Giacomo Boccardo <[email protected]>
  • Loading branch information
giacgbj committed Oct 24, 2024
1 parent 1e5c095 commit 154e75c
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
import java.security.PrivateKey;
import java.security.interfaces.RSAPublicKey;
import java.text.ParseException;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.time.Instant;

import org.json.JSONArray;
import org.json.JSONObject;
Expand Down Expand Up @@ -165,7 +164,7 @@ public static JWK getFirstJWK(JWKSet jwkSet) throws OIDCException {
* @return current UTC date time as epoch seconds
*/
public static long getIssuedAt() {
return LocalDateTime.now().toEpochSecond(ZoneOffset.UTC);
return Instant.now().getEpochSecond();
}

/**
Expand Down

0 comments on commit 154e75c

Please sign in to comment.