Skip to content

Support Java 8 java.time API #421

Closed
Closed

Description

@tradeJmark

Many modern systems have switched to using the java.time API that was introduced in Java 8. I believe that for maximum compatibility with newly created applications, it would be good to support this API alongside the current java.util.Date usages.

For example, in JWTCreator and JWTCreator.Builder, when dealing with expiration, the logical new API way would be to use a java.time.Instant. That way, you could easily write the following:

JWT.create()
    .withExpiresAt(Instant.now().plusSeconds(60 * 15))

It's not that it's impossible to do that with older Date and Calendar implementations, it's just that those classes are outdated (this article from 2017 talks about that), and it would be nice to use the same time API that other parts of most newly created applications are already using.

Activity

  1. tradeJmark commented on May 13, 2020

    @tradeJmark
    Author

    I'm sorry, I neglected to browse through the closed issues long enough to find out this is already coming in version 4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions