Unix time: Difference between revisions

Content deleted Content added
Line 238:
There has been some controversy over whether the Unix '''time_t''' should be signed or unsigned. If unsigned, its range in the future would be doubled, postponing the 32-bit overflow. However, it would then be incapable of representing times prior to 1970. [[Dennis Ritchie]], when asked about this issue, said that he hadn't thought very deeply about it, but was of the opinion that the ability to represent all times within his lifetime would be nice. (Ritchie's birth time is around Unix time -893400000.) The consensus, and universal practice, is for '''time_t''' to be signed.
 
Unix has no tradition of directly representing non-integer Unix time numbers as binary fractions. Instead, times with sub-second precision are represented using [[composite type|compound data type]]s that consist of two integers, the first being a '''time_t''' (the integral part of the Unix time), and the second being the fractional part of the time number in millionths (in '''struct timeval''') or billionths (in '''struct timespec'''). These structures provide a [[decimal]]-based [[fixed-point]] data format, which is useful for some applications, butand moretrivial oftento inconvenientconvert for others.
 
===UTC basis===