# Controller DateTime

**URL:** <https://forum.universal-robots.com/t/controller-datetime/23235>\
**Category:** Product Wishlist\
**Created:** [August 12, 2022, 2:22am UTC](https://forum.universal-robots.com/t/controller-datetime/23235 "2022-08-12T02:22:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MikeM](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/mikem/32/3114_2.png) [@MikeM](https://forum.universal-robots.com/u/MikeM)\
**Post date:** [August 12, 2022, 2:22am UTC](https://forum.universal-robots.com/t/controller-datetime/23235/1 "2022-08-12T02:22:51Z")

</div>

# Summary

Formal request for DateTime URscript functionality in Polyscope.

# What is it?

Adding functions such as:

_**URcontroller.get\_Time()**__returns array - [hh, mm, ss]_  
_**URcontroller.get\_Date()**_ _returns array - [DD, MM, YYYY]_  
_**URcontroller.get\_DateTime()**_ _returns array - [DD, MM, YYYY, hh, mm, ss]_  
_**URcontroller.get\_Year()**_ _returns integer_  
_**URcontroller.get\_Month()**_ _returns integer_  
_**URcontroller.get\_Day()**_ _returns integer_  
_**URcontroller.get\_Hour()**_ _returns integer_  
_**URcontroller.get\_Minute()**_ _returns integer_  
_**URcontroller.get\_Second()**_ _returns integer_  
_**URcontroller.get\_Elapsed\_Time(\<past\_time\>,\<present\_time\>)**_ \*returns array - [Days, Months, Years, Hours, Minutes, Seconds]  
_**URcontroller.is\_Time\_Exceeded(\<past\_time\>,\<present\_time\>)**_ _returns bool_

_**…add military and other additional formats (please feel free to add additional missing time based queries by replying below, I know I’m probably missing a few important ones)**_

# Why is it needed?

Currently the only solution for time based programs or requests are through **A) timers B) wait() and C) URcap** **[Get Controller Time](https://forum.universal-robots.com/t/urcap-sample-get-controller-time-in-urscript/1256)**. These work to an extent but can require additional modifications in the SDK to add additional functionality (if using URcap). This topic has been discussed in several forum posts and surprisingly hasn’t made it to becoming basic URscript functions for users to take advantage of (e.g. tracking time elapsed even through switching loaded programs, reseting variable after several days, log or data recording at specific intervals).

Hopefully this request doesn’t seem too specific but I’m curious to hear what others in the URcommunity think, thanks!

-Michael

---

<div class="post-metadata">

**Author:** ![sven.ziesche](https://avatars.discourse-cdn.com/v4/letter/s/d2c977/32.png) [@sven.ziesche](https://forum.universal-robots.com/u/sven.ziesche)\
**Post date:** [August 22, 2022, 4:01pm UTC](https://forum.universal-robots.com/t/controller-datetime/23235/2 "2022-08-22T16:01:37Z")

</div>

This all make sense only when you have accurate time in Polyscope. This is step #2 .  
Step #1 is in my opinion to ask a time server (internet or intranet) to set the original date/time to Polyscope.

---

<div class="post-metadata">

**Author:** ![anon507564](https://avatars.discourse-cdn.com/v4/letter/a/e480ec/32.png) [@anon507564](https://forum.universal-robots.com/u/anon507564)\
**Post date:** [August 22, 2022, 4:52pm UTC](https://forum.universal-robots.com/t/controller-datetime/23235/3 "2022-08-22T16:52:25Z")

</div>

My bots are not connected to any servers so I don’t want/need to connect to a time server, but having a Date/Time function based on poly-time would be much appreciated. .
