This article is a summary of our answers to various customers who have asked us how to convert between XJTAG, Windows and Unix timestamps, so that they can correctly pass data between test systems.

The time format used by both the NOW() and FORMAT() XJEase built-in functions is the number of milliseconds since 12am on January 1, 1601 UTC. This epoch is the same as that used by Microsoft Windows.  However, Windows counts time in units of 100-nanoseconds rather than 1-millisecond, so to convert between the Windows and XJTAG formats you must multiply/divide by 10000.

When converting between Unix time and XJTAG time, things are slightly more complicated. This is because Unix time is the number of seconds since 12am on January 1, 1970 UTC. The difference between this epoch and that used by XJTAG is 11644473600 seconds. Therefore, to convert between the two use the following:

Unix_Time := (XJTAG_Time / 1000) - 11644473600;
XJTAG_Time := (Unix_Time + 11644473600) * 1000;