# Get current system time from python

**URL:** <https://mworks.discourse.group/t/get-current-system-time-from-python/1033>\
**Category:** Support\
**Created:** [September 10, 2024, 2:06pm UTC](https://mworks.discourse.group/t/get-current-system-time-from-python/1033 "2024-09-10T14:06:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vonaviv](https://avatars.discourse-cdn.com/v4/letter/v/b19c9b/32.png) [@vonaviv](https://mworks.discourse.group/u/vonaviv)\
**Post date:** [September 10, 2024, 2:06pm UTC](https://mworks.discourse.group/t/get-current-system-time-from-python/1033/1 "2024-09-10T14:06:36Z")

</div>

Hi Chris,

Is there a way to request MWorks system time from within python? I have come up with a cumbersome solution, but it’s not ideal because it’s causing some delay:

MWorks

```auto
get_time = False {
    current_time = now()
}

```

Python

```python
def get_time()
    setvar ('get_time', True)
    return getvar ('current_time', True)

current_time = get_time()

```

Thanks!

Best,  
Vladyslav

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [September 10, 2024, 3:21pm UTC](https://mworks.discourse.group/t/get-current-system-time-from-python/1033/2 "2024-09-10T15:21:17Z")

</div>

Hi Vladyslav,

> Is there a way to request MWorks system time from within python?

There is, but at present it’s only in the MWorks [nightly build](https://mworks.github.io/downloads/). The function is called `get_current_time_us`.

Cheers,  
Chris

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [September 13, 2024, 2:05pm UTC](https://mworks.discourse.group/t/get-current-system-time-from-python/1033/3 "2024-09-13T14:05:45Z")

</div>

Closed on September 13, 2024, 2:05pm UTC


