# Time offsets in Canton

**URL:** <https://forum.canton.network/t/time-offsets-in-canton/6446>\
**Category:** App Development\
**Tags:** time, canton\
**Created:** [April 19, 2023, 12:18pm UTC](https://forum.canton.network/t/time-offsets-in-canton/6446 "2023-04-19T12:18:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mr\_Mannoroth](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/mr_mannoroth/32/5824_2.png) [@Mr\_Mannoroth](https://forum.canton.network/u/Mr_Mannoroth)\
**Post date:** [April 19, 2023, 12:18pm UTC](https://forum.canton.network/t/time-offsets-in-canton/6446/1 "2023-04-19T12:18:51Z")

</div>

Operating system time is in real date time. But let’s say I want Canton to use a different system time, eg:

```haskell
System time = real date time + time offset

```

where, say:  
real date time = 19 April **2023**  
time offset = -31536000 seconds  
So Canton system time = 19 April **2022**

Is this possible?

---

<div class="post-metadata">

**Author:** ![stefanobaghino-da](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/stefanobaghino-da/32/7057_2.png) [@stefanobaghino-da](https://forum.canton.network/u/stefanobaghino-da)\
**Post date:** [April 19, 2023, 3:24pm UTC](https://forum.canton.network/t/time-offsets-in-canton/6446/2 "2023-04-19T15:24:46Z")

</div>

You can set `canton.parameters.sim-clock = true` in your configuration to use a static clock, but you would have two have your own automated process to apply the desired offset.

However, it would probably be good to understand _why_ you need this, so that maybe we can understand if there are different ways to address your problem.

---

<div class="post-metadata">

**Author:** ![Mr\_Mannoroth](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/mr_mannoroth/32/5824_2.png) [@Mr\_Mannoroth](https://forum.canton.network/u/Mr_Mannoroth)\
**Post date:** [May 4, 2023, 3:13am UTC](https://forum.canton.network/t/time-offsets-in-canton/6446/3 "2023-05-04T03:13:42Z")

</div>

The client prefers their testing environment to use a system date that’s - year behind today’s date.

While it is straightforward to have their Java app apply this offset on any template or choice parameters of type Date or Time before it sends a command to the ledger, we also need any getTime calls in Daml or Event creation times at the ledger api server to be = now - 1 year.

1. Is using the parameter you suggested the only way? If yes, is this similar to the old sandbox’s static time concept? And so an automated process would need to keep calling setTime on the Time Service?

2. But the above setTime calls can’t be done every millisecond so how would this be done?

3. @stefanobaghino-da @oliverse Could we use [this RemoteClock concept](https://docs.daml.com/canton/scaladoc/com/digitalasset/canton/config/ClockConfig%24%24RemoteClock.html) to achieve what we need? How?

---

<div class="post-metadata">

**Author:** ![oliverse](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/oliverse/32/46_2.png) [@oliverse](https://forum.canton.network/u/oliverse)\
**Post date:** [May 4, 2023, 12:09pm UTC](https://forum.canton.network/t/time-offsets-in-canton/6446/4 "2023-05-04T12:09:27Z")

</div>

Hello Mr\_Mannoroth,

I just checked with our team. While `RemoteClock` might yield the behavior you would like to achieve, using the `SimClock` as suggested by Stefano earlier is the preferred approach. SimClock is what many of our tests are based on, and therefore using `SimClock` rather than `RemoteClock` is more likely to avoid pitfalls. This would of course require the SimClock to be updated at the granularity that the test environment needs.

For either approach to work, it would be essential to configure all nodes with the same clock.
