[ntp:questions] Converting from Y-m-d h:m:s

Hal Murray hal-usenet at ip-64-139-1-69.sjc.megapath.net
Sat May 15 08:30:32 UTC 2010

In article <4BEE2377.3040805 at signaturealpha.com>,
 Marc Leclerc <marc-leclerc at signaturealpha.com> writes:

>Thanks for your answer, the system I am working on is an ARM Linux based 
>embedded board. the device is intented for electric utilities and we 
>must meet good time precision, this device requires 1ms precision but 
>our next one will require micro second precision therefore I am going 
>for the bigger goal right away. There will not be any NTP server on the 
>network, they are rather looking in a mid-future at the precise time 
>protocol. My first intention was to use NTP with our on board GPS but it 
>turns out it aint supported and as time grows short going right to the 
>source may be my only way out. The standard (IEC-61850) demands time as 
>UTC and the GPS does support giving UTC time, only thing it gives it as 
>separate entries (Year, Month...). Since the time given by the GPS 
>already accounts for leap seconds would the formula you sent still give 
>me proper time if I am to be compared to other system

There are two issues: UTC and Posix.

UTC hickups occasionally when leap seconds are inserted.  If you
have a good watch, you will have to reset it to stay on the right time.

Posix time pretends that leap seconds don't exist.  If you
subtract two posix times that straddle one or more leap seconds
you will get the wrong answer.

Some GPS units give you a choice of GPS time or UTC.  If you use
UTC, the GPS box is doing the leap second correction.  If you convert
UTC time (YY-MM-DD) to Posix, you will get the right answer.  If you
convert GPS time (YY-MM-DD) to Posix, you will be off by the number
of leap seconds since GPS time started.

That offset is sent by the GPS satellites.  Some GPS units make it
available on their serial port messages.

These are my opinions, not necessarily my employer's.  I hate spam.

More information about the questions mailing list