# Time Service returns UNIMPLEMENTED: Method not found: com.daml.ledger.api.v1.testing.TimeService/GetTime

**URL:** <https://forum.canton.network/t/time-service-returns-unimplemented-method-not-found-com-daml-ledger-api-v1-testing-timeservice-gettime/4767>\
**Category:** App Development\
**Created:** [June 20, 2022, 9:02pm UTC](https://forum.canton.network/t/time-service-returns-unimplemented-method-not-found-com-daml-ledger-api-v1-testing-timeservice-gettime/4767 "2022-06-20T21:02:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![StephenOTT](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/stephenott/32/3953_2.png) [@StephenOTT](https://forum.canton.network/u/StephenOTT)\
**Post date:** [June 20, 2022, 9:02pm UTC](https://forum.canton.network/t/time-service-returns-unimplemented-method-not-found-com-daml-ledger-api-v1-testing-timeservice-gettime/4767/1 "2022-06-20T21:02:08Z")

</div>

Using java bindings and `daml start` i get `UNIMPLEMENTED: Method not found: com.daml.ledger.api.v1.testing.TimeService/GetTime` when calling `ledgerClient.timeClient.getTime()`

based on [Can't fetch the ledger time from DAML ledger through the JSON API - Stack Overflow](https://stackoverflow.com/questions/59477347/cant-fetch-the-ledger-time-from-daml-ledger-through-the-json-api) I see that it should not be available when in sandbox? But this appears to be older as it indicates the time service would be activated.

If time service is not available in sandbox, is there config that can be detected through the ledger api for a ledger being in sandbox mode / which services are available / not available based on the config?

Thanks

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [June 21, 2022, 6:42am UTC](https://forum.canton.network/t/time-service-returns-unimplemented-method-not-found-com-daml-ledger-api-v1-testing-timeservice-gettime/4767/2 "2022-06-21T06:42:42Z")

</div>

The time service is only intended for testing and is only available in static time mode. You can turn on static time via `daml sandbox --static-time`. Take a look at [Is it possible to start Canton Sandbox in static time mode, specified in the `daml.yaml` file? - #2 by cocreature](https://discuss.daml.com/t/is-it-possible-to-start-canton-sandbox-in-static-time-mode-specified-in-the-daml-yaml-file/4602/2) for some caveats if you try to do this in `daml start`.

As for detecting whether you’re in static time mode, you can catch the `unimplemented` exception. Navigator does something like this here [daml/PlatformStore.scala at f4211b709ffd31453ed94b99538c6434647f520d · digital-asset/daml · GitHub](https://github.com/digital-asset/daml/blob/f4211b709ffd31453ed94b99538c6434647f520d/navigator/backend/src/main/scala/com/digitalasset/navigator/store/platform/PlatformStore.scala#L423).

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [June 21, 2022, 6:43am UTC](https://forum.canton.network/t/time-service-returns-unimplemented-method-not-found-com-daml-ledger-api-v1-testing-timeservice-gettime/4767/3 "2022-06-21T06:43:32Z")

</div>

Maybe worth adding: If you’re just interested in getting the time and not in setting it, just get the utc time on the client side and make sure both your client & your ledger have ntp enabled.

---

<div class="post-metadata">

**Author:** ![StephenOTT](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/stephenott/32/3953_2.png) [@StephenOTT](https://forum.canton.network/u/StephenOTT)\
**Post date:** [June 21, 2022, 3:10pm UTC](https://forum.canton.network/t/time-service-returns-unimplemented-method-not-found-com-daml-ledger-api-v1-testing-timeservice-gettime/4767/4 "2022-06-21T15:10:35Z")

</div>

@cocreature thank you
