/* Extract milliseconds from PointMetadata */ require ("Application"); class TimeTest Application { point = #$DataPid:PID1.Pv; } method TimeTest.constructor () { local info = PointMetadata(.point); if (info) { princ ("Windows timestamp: ", info.timestamp, "\n"); // Timestamp is in days since Windows epoch. Change to seconds. 86400 seconds per day. local secs = info.timestamp * 86400; princ ("Seconds: ", secs, "\n"); // Extract the fractional seconds, multiply by 1000 for milliseconds, then truncate local msecs = int((secs % 1) * 1000); princ ("Milliseconds: ", msecs, "\n"); // Alternatively, convert to unix time, which is in seconds and then extract and truncate // These two methods could be off by a millisecond due to floating point math error. local msecs2 = int(WindowsTimeToUnixTime(info.timestamp) % 1 * 1000); princ ("Milliseconds: ", msecs2, "\n"); } } ApplicationSingleton (TimeTest);