# Current date/time in smart contract

**URL:** <https://forum.flow.com/t/current-date-time-in-smart-contract/1971>\
**Category:** 🏄🏻‍♀️ Cadence\
**Created:** [May 23, 2021, 2:00pm UTC](https://forum.flow.com/t/current-date-time-in-smart-contract/1971 "2021-05-23T14:00:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlexZ](https://avatars.discourse-cdn.com/v4/letter/a/5daacb/32.png) [@AlexZ](https://forum.flow.com/u/AlexZ)\
**Post date:** [May 23, 2021, 2:00pm UTC](https://forum.flow.com/t/current-date-time-in-smart-contract/1971/1 "2021-05-23T14:00:15Z")

</div>

Hi Everyone,

I’m developing a smart contract which logic depends on current date/time. Basing on its value the contract should allow/disallow certain actions (for instance a user should be allowed to withdraw a balance no more than once per week). For this case it should identify current date/time when the transaction is processing. Pls advise what is the best way to do this? Any examples would be great.

Thanks in advance,  
Alex

---

<div class="post-metadata">

**Author:** ![j00lz](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.flow.com/j00lz/32/1940_2.png) [@j00lz](https://forum.flow.com/u/j00lz)\
**Post date:** [May 24, 2021, 5:07am UTC](https://forum.flow.com/t/current-date-time-in-smart-contract/1971/2 "2021-05-24T05:07:45Z")

</div>

Hi Alex,

You can get the timestamp of the latest block though there is no guarantee of the accuracy at the moment so be careful how you use it:

> **[Environment Information](https://docs.onflow.org/cadence/language/environment-information#block-information)**
>
> Start Building in the Open
