Time.gGetCurrentWindowsTime — returns the current clock time in Windows time format.PointGetUnixTime — gets the Unix time stamp from a point.PointGetWindowsTime — gets the Windows time stamp from a point.PointMetadata — queries a point for its metadata structure.UnixLocalToUTC — converts from local Unix time to UTC.UnixTimeToWindowsTime — converts from Unix time to Windows time.UnixUTCToLocal — converts from UTC Unix time to local time.WindowsLocalToUTC — converts from local Windows time to UTC.WindowsTimeToUnixTime — converts from Windows time to Unix time.WindowsUTCToLocal — converts from UTC Windows time to local time.The DataHub program works in two different time standards:
Windows DATE (VT_DATE) is the number of
days, as an 8-byte float since December 30, 1899. The fractional part is
unsigned, so 6 a.m. December 29, 1899 would be represented as -1.25.
Unix time is the number of seconds since 12 a.m. January 1, 1970. It is a signed 4-byte integer. Negative times have no meaning.
In these functions, Unix time uses the traditional Unix time plus a number of nanoseconds. Since this cannot be expressed as a single 4-byte integer, we express it as an 8-byte floating point number where the fractional part adds accuracy. This accuracy is ideally measured down to the nanosecond, but in practise relies on the accuracy of the operating system clock. In Windows, this means milliseconds.
Unix time is important because it is the time format used in the Gamma functions
time,
mktime, localtime and date. It is
also the time format used when explicitly specifying a time stamp on a point in
Unix.
Windows time is the internal time representation used by DataHub points.
The functions listed here are created in the script Time.g
located in the require
folder of your DataHub installation. They are available to any DataHub script that
requires or includes the Time.g file, using one of these
statements:
require ("Time");
include ("Time");