Unable to get timezone for Key Activation/Expiry date

Sagar Lonkar 1 Reputation point
2022-09-15T09:31:37.313+00:00

I am using Java Azure SDK for getting key vault key properties

keyVaultKey.getProperties().getNotBefore()
keyVaultKey.getProperties().getExpiresOn()

returns date & time but zone information is missing
2024-09-13T14:08:30Z

Please help on this.

Azure Key Vault
Azure Key Vault
An Azure service that is used to manage and protect cryptographic keys and other secrets used by cloud apps and services.
1,453 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Zulfi Ahmad 1 Reputation point
    2022-09-16T13:27:46.957+00:00

    I believe the Z suffix in the datetime you've pasted above (ex: 2024-09-13T14:08:30Z) signify that the datetimes are in GMT/UTC time.

    https://en.wikipedia.org/wiki/ISO_8601#Coordinated_Universal_Time_(UTC)

    Z

    0 comments No comments

  2. Shweta Mathur 30,296 Reputation points Microsoft Employee Moderator
    2022-09-19T11:03:16.933+00:00

    Hi @Sagar Lonkar ,

    Thanks for reaching out.

    Key attributes ExpiryOn and NotBefore gets the date in UTC format.
    UTC datetime format is Y-m-d'T'H:M:S'Z'.

    Hope this will help.

    Thanks,
    Shweta

    -----------------------------------------

    Please remember to "Accept Answer" if answer helped you.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.