# How to convert timestamp in Robot Mode Data from the realtime interface

**URL:** <https://forum.universal-robots.com/t/how-to-convert-timestamp-in-robot-mode-data-from-the-realtime-interface/1596>\
**Category:** Robot Communication\
**Created:** [February 6, 2018, 1:44pm UTC](https://forum.universal-robots.com/t/how-to-convert-timestamp-in-robot-mode-data-from-the-realtime-interface/1596 "2018-02-06T13:44:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon58840761](https://avatars.discourse-cdn.com/v4/letter/a/e9c0ed/32.png) [@anon58840761](https://forum.universal-robots.com/u/anon58840761)\
**Post date:** [February 6, 2018, 1:44pm UTC](https://forum.universal-robots.com/t/how-to-convert-timestamp-in-robot-mode-data-from-the-realtime-interface/1596/1 "2018-02-06T13:44:28Z")

</div>

![image](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/1X/4b23df5d622bf0ba9dbb90b9ac03b8fad080a4d4.png)  
when i read the 8 bytes in as long  
i get these values below when trying to convert them from epoch time to realtime

22168000 = 09/14/1970 @ 1:46pm (UTC) starttime  
27696000 = 11/17/1970 @ 1:20pm (UTC) endtime

the times are months apart which should be only seconds, when i took the timestamps.

so the question is how do i use the values?

---

<div class="post-metadata">

**Author:** ![jbm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/jbm/32/614_2.png) [@jbm](https://forum.universal-robots.com/u/jbm)\
**Post date:** [February 6, 2018, 1:56pm UTC](https://forum.universal-robots.com/t/how-to-convert-timestamp-in-robot-mode-data-from-the-realtime-interface/1596/2 "2018-02-06T13:56:23Z")

</div>

The timestamp value sent over the Client interface is similar to the timestamp in [RTDE](https://www.universal-robots.com/how-tos-and-faqs/how-to/ur-how-tos/real-time-data-exchange-rtde-guide-22229/).  
It is the time elapsed since the controller (software process) was started, not the “world time”.  
Hence, you cannot convert this to day/month/year etc.

---

<div class="post-metadata">

**Author:** ![anon58840761](https://avatars.discourse-cdn.com/v4/letter/a/e9c0ed/32.png) [@anon58840761](https://forum.universal-robots.com/u/anon58840761)\
**Post date:** [February 6, 2018, 2:24pm UTC](https://forum.universal-robots.com/t/how-to-convert-timestamp-in-robot-mode-data-from-the-realtime-interface/1596/3 "2018-02-06T14:24:12Z")

</div>

Explains alot, I guess its microseconds 22168000/1000000 = 22.16 sec ?

---

<div class="post-metadata">

**Author:** ![philip](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/philip/32/722_2.png) [@philip](https://forum.universal-robots.com/u/philip)\
**Post date:** [April 17, 2018, 4:22am UTC](https://forum.universal-robots.com/t/how-to-convert-timestamp-in-robot-mode-data-from-the-realtime-interface/1596/4 "2018-04-17T04:22:20Z")

</div>

While the RTDE (30004) and real time client (30003) return the timestamp in nice, easy to understand fractional seconds since power up, the timestamp values from the secondary client (30002) are in number of time slices (8ms) when connected to a physical robot. When connected to a simulated robot the timestamp value is in number of microseconds (1us) since power up.

So with your example:

Physical robot:  
22168000\*8ms = 49h:15m:44.00s  
27696000\*8ms = 61h:32m:48.00s

Simulated robot:  
22168000\*1us = 00h:00m:22.16s  
27696000\*1us = 00h:00m:27.69s

Sounds like you were doing this on a simulated robot…

---

<div class="post-metadata">

**Author:** ![anon89446105](https://avatars.discourse-cdn.com/v4/letter/a/ea5d25/32.png) [@anon89446105](https://forum.universal-robots.com/u/anon89446105)\
**Post date:** [May 31, 2019, 9:57pm UTC](https://forum.universal-robots.com/t/how-to-convert-timestamp-in-robot-mode-data-from-the-realtime-interface/1596/5 "2019-05-31T21:57:01Z")

</div>

Where is this documented?
