The DataHub 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, and are available to any DataHub script that requires or includes the Time.g file, using one of these statements:
require ("Time");
include ("Time");
Table of Contents
Copyright © 1995-2010 by Cogent Real-Time Systems, Inc. All rights reserved.