From 5a87c8f2ee11d47eadd24c35950d8d070456d590 Mon Sep 17 00:00:00 2001 From: froejdh_e Date: Mon, 27 Oct 2025 16:28:36 +0100 Subject: [PATCH] added example to time conversion --- docs/src/pyexamples.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/src/pyexamples.rst b/docs/src/pyexamples.rst index 9521b32c0..1d7eedd4b 100755 --- a/docs/src/pyexamples.rst +++ b/docs/src/pyexamples.rst @@ -50,6 +50,12 @@ datetime.timedelta, DurationWrapper or by setting the time in seconds. >>> d.getExptime() [sls::DurationWrapper(total_seconds: 181.23 count: 181230000000)] + # In C++ it is possible to use chrono literals to set time more easily + # d.setExptime(7ms). However, this is not possible due to pythons syntax. + # instead we can create a unit that we use for conversion. + >>> ms = dt.timedelta(milliseconds = 1) + >>> d.exptime = 7.5*ms + ------------------------------------