# How can I make a token expire in 30 seconds please?

**URL:** <https://community.auth0.com/t/how-can-i-make-a-token-expire-in-30-seconds-please/68642>\
**Category:** JWT.io\
**Tags:** expiration\
**Created:** [August 26, 2021, 6:10pm UTC](https://community.auth0.com/t/how-can-i-make-a-token-expire-in-30-seconds-please/68642 "2021-08-26T18:10:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![DonnaMara](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/donnamara/32/18373_2.png) [@DonnaMara](https://community.auth0.com/u/DonnaMara)\
**Post date:** [August 26, 2021, 6:10pm UTC](https://community.auth0.com/t/how-can-i-make-a-token-expire-in-30-seconds-please/68642/1 "2021-08-26T18:10:35Z")

</div>

I notice I can add “exp”: 30 in the header, but that would mean 30 seconds since Unix time so not very useful; i need 30 sec since present time.  
any help please?

---

<div class="post-metadata">

**Author:** ![DonnaMara](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/donnamara/32/18373_2.png) [@DonnaMara](https://community.auth0.com/u/DonnaMara)\
**Post date:** [August 26, 2021, 7:19pm UTC](https://community.auth0.com/t/how-can-i-make-a-token-expire-in-30-seconds-please/68642/2 "2021-08-26T19:19:29Z")

</div>

I managed to obtain the datetime in numericdate by doing this:

var myDate1 = DateTimeOffset.Now.ToUnixTimeSeconds();  
Console.WriteLine(myDate1 + 30);

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [August 27, 2021, 10:59am UTC](https://community.auth0.com/t/how-can-i-make-a-token-expire-in-30-seconds-please/68642/3 "2021-08-27T10:59:32Z")

</div>

Perfect! Thanks for sharing that with the rest of community!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [September 11, 2021, 10:59am UTC](https://community.auth0.com/t/how-can-i-make-a-token-expire-in-30-seconds-please/68642/4 "2021-09-11T10:59:52Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
