Time Intro - Time and NTP

来源:互联网 发布:淘宝介入举证怎么办 编辑:程序博客网 时间:2024/06/05 18:41




1.  The functions gettimeofday() and settimeofday() can get and set the time as well as a timezone. The tv argument is a struct timeval (as specified in <sys/time.h>):
struct timeval {
    time_t      tv_sec;     /* seconds */
    suseconds_t tv_usec;    /* microseconds */
};
and gives the number of seconds and microseconds since the Epoch (see time(2)).
1970-01-01 00:00:00 +0000 (UTC).


2.  time() returns the time as the number of seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC).


3.  Wallclock time (absolute date and time) is represented using the timestamp format of the Network
Time Protocol (NTP), which is in seconds relative to 0h UTC on 1 January 1900 [4]. The full
resolution NTP timestamp is a 64-bit unsigned fixed-point number with the integer part in the
first 32 bits and the fractional part in the last 32 bits.



0 0
原创粉丝点击