Skip to content
CCPEDIAby Unity Nodes
Discussions/App Development/Programmatically setting the timeForum ↗

Programmatically setting the time

App Development3 posts445 views6 likesLast activity Apr 2021
ER
Ericson2314OP
Apr 2021

I see Can I imitate the passing of time with REPL? which seems related.

We have a demostration application where on the frontend we’d like to allow users to spoof a different current date. The idea being that this allows them to verify certain flows work without having to wait for the real time to elapse. Is such a thing possible? Or does one have to restart daml using the CLI flags described in that thread?

BE
bernhard
Apr 2021

Hi @Ericson2314 , welcome to the Daml forums.

If you are running a development ledger (ie the Sandbox) in static time mode, you can use the TimeService to set the time. Daml REPL and Script go through the Ledger API so anything you can do there, you can do from your own client application, too. Just. a matter of finding the right service :wink:

Ed.: To start the Sandbox in static time mode use the --static-time CLI flag or add this to your daml.yaml:

sandbox-options:
  - --static-time
ER
Ericson2314
Apr 2021

Thanks!

← Back to Discussions