Site banner
.
Home Forums Blogs Articles Photos Videos Contact FAQ                    
.
.
Wisdom Archive
Body Mind and Soul
Faith and Belief
God and Religion
Law of Attraction
Life and Beyond
Love and Happiness
Peace of Mind
Peace on Earth
Personal Faith
Spiritual Festivals
Spiritual Growth
Spiritual Guidance
Spiritual Inspiration
Spirituality and Science
Spiritual Retreats
More Wisdom
Buddhism Archives
Hinduism Archives
Sustainability
Theology Archives
Even more Wisdom
2012 - Year 2012
Affirmations
Aura
Ayurveda
Chakras
Consciousness
Cultural Creatives
Diksha (Deeksha)
Dream Dictionary
Dream Interpretation
Dream interpreter
Dreams
Enlightenment
Essential Oils
Feng Shui
Flower Essences
Gaia Hypothesis
Indigo Children
Kalki Bhagavan
Karma
Kundalini
Kundalini Yoga
Life after death
Mayan Calendar
Meaning of Dreams
Meditation
Morphogenetic Fields
Psychic Ability
Reincarnation
Spiritual Art, Music & Dance
Spiritual Awakening
Spiritual Enlightenment
Spiritual Healing
Spirituality and Health
Spiritual Jokes
Spiritual Parenting
Vastu Shastra
Womens Spirituality
Yoga Positions
Site map 2
Site map


Dream Sharing Forum

at Global Oneness Community.

Share your dreams and let others help you with the interpretation!
Dream Sharing Forum



.

Unix time - Definition

Unix time - Definition: Encyclopedia II - Unix time - Definition

There are two layers of encoding that make up Unix time, and they can be usefully separated. The first layer encodes a point in time as a scalar real number, and the second encodes that number as a sequence of bits or in some other manner. Unix time - Encoding time as a number. Modern Unix time is based strictly on UTC. UTC counts time using SI seconds, and breaks up the span of time into days. UTC days are mostly 86400 s long, but are occasionally 86401 s and could be 86399 s long (though the la ...

See also:

Unix time, Unix time - Definition, Unix time - Encoding time as a number, Unix time - Representing the number, Unix time - UTC basis, Unix time - History, Unix time - 32-bit overflow, Unix time - time_t parties

Unix time, Unix time - 32-bit overflow, Unix time - Definition, Unix time - Encoding time as a number, Unix time - History, Unix time - Representing the number, Unix time - UTC basis, Unix time - time_t parties, Unununium Time, Year 2000 problem, Year 2038 problem

Unix time: Encyclopedia II - Unix time - Definition



Unix time - Definition

There are two layers of encoding that make up Unix time, and they can be usefully separated. The first layer encodes a point in time as a scalar real number, and the second encodes that number as a sequence of bits or in some other manner.

Unix time - Encoding time as a number

Modern Unix time is based strictly on UTC. UTC counts time using SI seconds, and breaks up the span of time into days. UTC days are mostly 86400 s long, but are occasionally 86401 s and could be 86399 s long (though the latter option has never been used as of December 2005) in order to keep the days synchronised with the rotation of the Earth. As is standard with UTC, this article will label days using the Gregorian calendar, and count times within each day in hours, minutes, and seconds. Some of the examples will also show TAI, another time scheme, which uses the same seconds and is displayed in the same format as UTC, but has every day exactly 86400 s long, making no attempt to stay synchronised with the Earth's rotation.

The Unix epoch is the time 00:00:00 UTC on January 1, 1970. There is a problem with this definition, in that UTC did not exist in its current form until 1972; this issue is discussed below. For brevity, the remainder of this section will use ISO 8601 date format, in which the Unix epoch is 1970-01-01T00:00:00Z.

The Unix time number is zero at the Unix epoch, and increases by exactly 86 400 per day since the epoch. Thus 2004-09-16T00:00:00Z, 12 677 days after the epoch, is represented by the Unix time number 12 677 × 86 400 = 1 095 292 800. This can be extended backwards from the epoch too, using negative numbers; thus 1957-10-04T00:00:00Z, 4472 days before the epoch, is represented by the Unix time number -4472 × 86 400 = -386 380 800.

Within each day, the Unix time number is as calculated in the preceding paragraph at midnight UTC (00:00:00Z), and increases by exactly 1 per second since midnight. Thus 2004-09-16T17:55:43.54Z, 64 543.54 s since midnight on the day in the example above, is represented by the Unix time number 1 095 292 800 + 64 543.54 = 1 095 357 343.54. On dates before the epoch the number still increases, thus becoming less negative, as time moves forward.

The above scheme means that on a normal UTC day, of duration 86 400 s, the Unix time number changes in a continuous manner across midnight. For example, at the end of the day used in the examples above, the time representations progress like this:

When a leap second occurs, so that the UTC day is not exactly 86 400 s long, a discontinuity occurs in the Unix time number. The Unix time number increases by exactly 86 400 each day, regardless of how long the day is. When a leap second is deleted (which has never occurred, as of 2006), the Unix time number jumps up by 1 at the instant where the leap second was deleted from, which is the end of the day. When a leap second is inserted (which has occurred on average once every year and a half), the Unix time number increases continuously during the leap second, during which time it is more than 86 400 s since the start of the current day, and then jumps down by 1 at the end of the leap second, which is the start of the next day. For example, this is what happened on strictly conforming POSIX.1 systems at the end of 1998:

Observe that when a positive leap second occurs (i.e., when a leap second is inserted) the Unix time numbers repeat themselves. The Unix time number 915 148 800.50 is ambiguous: it can refer either to the instant in the middle of the leap second, or to the instant one second later, half a second after midnight UTC. In the theoretical case when a negative leap second occurs (i.e., when a leap second is deleted) no ambiguity is caused, but instead there is a range of Unix time numbers that do not refer to any point in time at all.

It is a common mistake to implement a Unix clock with the Network Time Protocol's differing handling of positive leap seconds. This yields a system that does not conform to the POSIX standard. See the section below concerning NTP for details.

When dealing with time periods that do not encompass a UTC leap second, the difference between two Unix time numbers is equal to the duration in seconds of the time period between the corresponding points in time. This is a common computational technique. However, where leap seconds occur, such calculations give the wrong answer. In applications where this level of accuracy is required, it is necessary to consult a table of leap seconds when dealing with Unix times, and it is often preferable to use a different time encoding that does not suffer this problem.

A Unix time number is easily converted back into UTC by taking the quotient and modulus of the Unix time number, modulo 86400. The quotient is the number of days since the epoch, and the modulus is the number of seconds since midnight UTC on that day. (It is important to ensure that the right type of modulus is being calculated when dealing with times before the epoch.) If given a Unix time number that is ambiguous due to a positive leap second, this algorithm will interpret it as the time just after midnight. It will never generate a time that is during a leap second. If given a Unix time number that is invalid due to a negative leap second, it will generate an equally invalid UTC time. If these conditions are significant then it is necessary to consult a table of leap seconds in order to detect them.

To complicate things, the Network Time Protocol handles positive leap seconds differently. It has its own numeric time representation, very similar to Unix time but with a different epoch date and different leap second behaviour. NTP time repeats the second preceding the leap second, rather than the second following the leap second. Unix clocks controlled by NTP are usually implemented by just adding a constant offset to the NTP time, and therefore usually behave like this:

Such behaviour does not conform to POSIX.1, but is very common. As a result, Unix times such as 915 148 799.50, apparently in the second preceding a leap second, are de facto ambiguous, as are (both de facto and de jure) times such as 915 148 800.50.

Another, much rarer, non-conforming variant of Unix time keeping involves encoding TAI rather than UTC. Because TAI has no leap seconds, and every TAI day is exactly 86 400 s long, this encoding is actually a pure linear count of seconds elapsed since 1970-01-01T00:00:00 TAI. This makes time interval arithmetic much easier. Time values from these systems do not suffer the ambiguity that strictly conforming POSIX systems or NTP-driven systems have.

In these systems it is necessary to consult a table of leap seconds in order to correctly convert between UTC and the pseudo-Unix-time representation. This resembles the manner in which time zone tables must be consulted in order to convert to and from civil time. The leap second table must be updated (from the published leap second bulletins) more frequently than the time zone tables, because leap seconds occur at shorter notice than changes to daylight saving time rules. (A standard Unix time system must similarly consult a leap second table to convert to and from TAI, but this is a much rarer requirement.) Conversion also runs into definitional problems prior to the 1972 commencement of the current form of UTC (see the later section about UTC).

This TAI-based system, despite its superficial resemblance, is not Unix time. It encodes times with significantly different values from the POSIX time values, and does not have the simple mathematical relationship to UTC that is mandated by POSIX.

Unix time - Representing the number

A Unix time number can be represented in any form capable of representing numbers. In some applications the number is simply represented textually as a string of decimal digits, raising only trivial additional issues. However, there are certain binary representations of Unix times that are of particular significance.

The standard Unix time_t (data type representing a point in time) is a signed integer data type, traditionally of 32 bits (but see below), directly encoding the Unix time number as described in the preceding section. Being integer means that it has a resolution of one second; many Unix applications therefore handle time only to that resolution. Being 32 bits (of which one bit is the sign bit) means that it covers a range of about 136 years in total. The minimum representable time is 1901-12-13T20:45:52Z, and the maximum representable time is 2038-01-19T03:14:07Z. At 2038-01-19T03:14:08Z this representation will overflow. This milestone is anticipated with a mixture of amusement and dread; see the separate section below.

In some newer operating systems, time_t has been widened to 64 bits. In the negative direction, this goes back more than twenty times the age of the universe, and so suffices. In the positive direction, whether the 290 billion representable years is truly sufficient depends on the ultimate fate of the universe, but it is certainly adequate for most practical purposes.

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 compound data types 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, but more often inconvenient.

Unix time - UTC basis

The present form of UTC, with leap seconds, is defined only from January 1, 1972 onwards. Prior to that, since January 1, 1961 there was an older form of UTC in which not only were there occasional time steps, which were by non-integer numbers of seconds, but also the UTC second was slightly longer than the SI second, and periodically changed, in order to continuously approximate the Earth's rotation. Prior to 1961 there was no UTC, and prior to 1958 there was no widespread atomic timekeeping; in these eras, some approximation of GMT (based directly on the Earth's rotation) was used instead of an atomic timescale.

The precise definition of Unix time as an encoding of UTC is only uncontroversially applicable to the present form of UTC. Fortunately, the fact that the Unix epoch predates the start of this form of UTC does not affect its use in this era: the number of days from January 1, 1970 (the Unix epoch) to January 1, 1972 (the start of UTC) is not in question, and the number of days is all that is significant to Unix time.

The meaning of Unix time values below +63072000 (i.e., prior to January 1, 1972) is not precisely defined. The basis of such Unix times is best understood to be an unspecified approximation of GMT. Computers of that era rarely had clocks set sufficiently accurately to provide meaningful sub-second timestamps in any case. Unix time is not a suitable way to represent times prior to 1972 in applications requiring sub-second precision; such applications must, at least, define which form of UT or GMT they are using.

As of 2004, the possibility of ending the use of leap seconds in civil time is being considered. A likely means to execute this change is to define a new time scale, called "International Time", that initially matches UTC but thereafter has no leap seconds, thus remaining at a constant offset from TAI. If this happens, it is likely that Unix time will be prospectively defined in terms of this new time scale, instead of UTC. Uncertainty about whether this will occur makes prospective Unix time no less predictable than it already is: if UTC were simply to have no further leap seconds the result would be the same.

Other related archives

1901, 1958, 1961, 1970, 1971, 1972, 1980s, 1988, 1990s, 1998, 2001, 2004, 2005, 2006, 2009, 2038, 2100, December 13, Dennis Ritchie, Earth, February 13, Freenode, GMT, Gregorian calendar, Hz, IRC, ISO 8601, January 1, January 10, January 19, Java programming language, March 18, Network Time Protocol, November 3, POSIX, SI, September 9, TAI, UTC, Unix, Unix billennium, Unununium Time, Year 2000 problem, Year 2038 problem, age of the universe, as of December 2005, bignum, binary, bits, compiling, compound data types, continuous, daylight saving time, days, de facto, de jure, decimal, discontinuity, epoch, epoch date, fixed-point, hours, integer, leap second, leap seconds, leap year, minutes, new year, overflow, real number, reverse engineer, scalar, seconds, source code, time, ultimate fate of the universe, year 2000 problem, year 2038 problem



Adapted from the Wikipedia article "Definition", under the G.N U Free Docmentation License. Please also see http://en.wikipedia.org/wiki

More material related to Unix Time can be found here:
Main Page
for
Unix Time
Index of Articles
related to
Unix Time


« Back








Search the Global Oneness web site
Global Oneness is a huge, really huge, web site. Almost whatever you are searching for within health, spirituality, personal development and inspirationals - you will find it here!
Google
 
 

Rate this article!

Please rate this article with 10 as very good and 1 as very poor.

.








Sneak-Peek of Global Oneness Community

Hi friend! The Global Oneness Community, the place for information and sharing about Oneness is not really launched yet (you will see there is still some clean up to do) ...but it is now open for a sneak-peek! And if you wish - please register and become one of the very first members to do so! Jonas

Forum Home, Articles, Photo Gallery, Videos, News, Sitemap
...and much more!


Dream Sharing Forum

at Global Oneness Community.

Share your dreams and let others help you with the interpretation!
Dream Sharing Forum



Forum
Articles
Images Pictures
Videos
News
Sitemap




 

 

 

 

 


 








  » Home » » Home »