# Time diagnostics

**URL:** <https://discourse.mcneel.com/t/time-diagnostics/108220>\
**Category:** Grasshopper\
**Created:** [September 6, 2020, 6:24pm UTC](https://discourse.mcneel.com/t/time-diagnostics/108220 "2020-09-06T18:24:29Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Joseph\_Oster](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/joseph_oster/32/549124_2.png) [@Joseph\_Oster](https://discourse.mcneel.com/u/Joseph_Oster)\
**Post date:** [September 6, 2020, 7:28pm UTC](https://discourse.mcneel.com/t/time-diagnostics/108220/3 "2020-09-06T19:28:34Z")

</div>

You might be able to adapt this? Two copies, read the time before and after, then calc the difference?

> [@How to save current date and time?](https://discourse.mcneel.com/t/how-to-save-current-date-and-time/85921/2):
>
> I’d start with this? [date\_time] Oh, wait… Time is fixed to the moment you first put it on the canvas and doesn’t change. Kind of useless, isn’t it. frowning Here’s a Python thing; every time you push the button (or otherwise trigger the ‘x’ input?), the date/time updates: import datetime now = datetime.datetime.now() Y = now.year M = now.month D = now.day h = now.hour m = now.minute s = now.second [time\_date\_2019Jul8a.gh](https://discourse.mcneel.com/uploads/short-url/A6goZlUFyg4fi5M5Dy2z1Jy6IYI.gh) (5.5 KB)

Here’s a Python thing; every time you push the button (or otherwise trigger the ‘x’ input?), the date/time updates:

```auto
import datetime
now = datetime.datetime.now()
Y = now.year
M = now.month
D = now.day
h = now.hour
m = now.minute
s = now.second

```

 ![date_time.png](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/b/4/b49ce00f34a6424e582c391489e8f67473c5adee.png)  
[time\_date\_2019Jul8a.gh](https://discourse.mcneel.com/uploads/short-url/A6goZlUFyg4fi5M5Dy2z1Jy6IYI.gh) (5.5 KB)

---

_[View the full topic](https://discourse.mcneel.com/t/time-diagnostics/108220)._
