Visual Basic (Declaration) | |
---|---|
Public Overridable Sub UpdateTimestamp( _ ByVal seconds As UInteger, _ ByVal fractionalSeconds As ULong _ ) |
C# | |
---|---|
public virtual void UpdateTimestamp( uint seconds, ulong fractionalSeconds ) |
C++/CLI | |
---|---|
public: virtual void UpdateTimestamp( uint seconds, ulong fractionalSeconds ) |
Parameters
- seconds
- The number of GPS time seconds. This is the number of linear seconds since 1980-01-06 00:00:00Z (i.e. January 6, 1980 UTC) which is the definition of GPS time.
- fractionalSeconds
- The fractional number of seconds which is expressed as the number of attoseconds.
Converting from UTC time to the number of GPS seconds since the start of the GPS time epoch can be done by subtracting the start of the GPS time epoch in UTC from the date time in UTC that you wish to convert and then accounting for leap seconds since the start of the GPS time epoch (because the .NET DateTime and DateTimeOffset don't take leap seconds into account when subtracting two UTC dates). For example:
var now = DateTime.UtcNow; // Note: Use Ticks instead of TotalSeconds when differencing in order to avoid numeric // issues when separating into the seconds and fractional seconds parts. long ticks = now.Subtract(DateTime.Parse("1980-01-06Z").ToUniversalTime()).Ticks; uint seconds = Convert.ToUInt32(ticks / 10000000L); // 1E7 of 100ns ticks per second ulong fractionalSeconds = Convert.ToUInt64(ticks - seconds * 10000000L) * 100000000000UL; // 1E11 attoseconds per 100ns tick secs += 18; // To account for leap seconds since .net doesn't take that into account when differencing UTC date times.
Target Platforms: Windows 11 Professional or Enterprise; Windows 10 Professional, Enterprise, or Education (64-bit)
Minimum Software Version Requirement: Keysight PathWave 89600 VSA Ver 28.40