So I originally was using |2208988800| as NTP_DELTA, but for a more 
correct feel, I borrowed from the ntplib package.  The SYSTEM_EPOCH, 
NTP_EPOCH, and NTP_DELTA were originally module globals in ntplib; I 
could make them module globals in generic_functions as well and that 
would minimize the calls to datetime?  I currently only have them 
together in a function because Mueller told me about the time utilities 
in COI-services that he would like to bring over to ion-functions, so I 
wanted all of the variables together in a nice deletable package for 
when those are brought over.

Any suggestions?

-Stuart

On 4/16/2013 6:02 AM, Luke Campbell wrote:
> In ion_functions/data/generic_functions.py:
>
>> +
>> +        >>> ntp_ts = 3574792037.958
>> +
>> +        >>> unix_ts = ntp_to_unix_time(ntp_ts)
>> +        >>> unix_ts
>> +        1365803237.9580002
>> +
>> +    References:
>> +
>> +        The NTP FAQ and HOWTO (2006). http://www.ntp.org/ntpfaq/
>> +    """
>> +    SYSTEM_EPOCH = datetime.date(*time.gmtime(0)[0:3])
>> +    NTP_EPOCH = datetime.date(1900, 1, 1)
>> +    NTP_DELTA = (SYSTEM_EPOCH - NTP_EPOCH).total_seconds()
>> +
>> +    unix_timestamp = ntp_timestamp - NTP_DELTA
>
> NTP_DELTA is always |2208988800| this can actually be simplified to
> |return ntp_timestamp - 2208988800| which will prevent all the extra
> date calls, but don't worry about it unless you're going to be calling
> this method a lot.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/ooici/ion-functions/pull/14/files#r3811241>.
>