# Current Timestamp in Sway

**URL:** <https://forum.fuel.network/t/current-timestamp-in-sway/5835>\
**Category:** Sway\
**Created:** [June 16, 2024, 5:01am UTC](https://forum.fuel.network/t/current-timestamp-in-sway/5835 "2024-06-16T05:01:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cctdaniel](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/cctdaniel/32/2762_2.png) [@cctdaniel](https://forum.fuel.network/u/cctdaniel)\
**Post date:** [June 16, 2024, 5:01am UTC](https://forum.fuel.network/t/current-timestamp-in-sway/5835/1 "2024-06-16T05:01:03Z")

</div>

Is there any way to get the current timestamp in sway? Context: I want to prevent a price update with a future timestamp in my contract so I want to check with the current timestamp, is that possible? Otherwise, what would the alternative suggestion be in this case?

---

<div class="post-metadata">

**Author:** ![crypt0mate](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/crypt0mate/32/2445_2.png) [@crypt0mate](https://forum.fuel.network/u/crypt0mate)\
**Post date:** [June 16, 2024, 9:56pm UTC](https://forum.fuel.network/t/current-timestamp-in-sway/5835/2 "2024-06-16T21:56:24Z")

</div>

Hi @cctdaniel

can you take a look at this example here and see if you can piggyback some code [sway-applications/timelock at 32ad29b742bc0cd786e79908ad3578d5b508c2c7 · FuelLabs/sway-applications (github.com)](https://github.com/FuelLabs/sway-applications/tree/32ad29b742bc0cd786e79908ad3578d5b508c2c7/timelock)

 ![image](https://us1.discourse-cdn.com/flex022/uploads/fuel/original/2X/3/3f2c51bc631d892112fa8d2b528b215ebe2c06c0.png)

There are other examples that make use of timestamp in sway examples repo like the [name-registry](https://github.com/FuelLabs/sway-applications/tree/32ad29b742bc0cd786e79908ad3578d5b508c2c7/name-registry)

searching the sway-applications repo is a good place to see how many other things can be achieved  
[FuelLabs/sway-applications: Swaypplications (github.com)](https://github.com/FuelLabs/sway-applications)

hope that helps
