…
The POSIX time, or Unix time, is the number of seconds elapsed from the midnight of January 1st 1970 in UTC coordinates. That zero moment, known as the epoch, is simply the start of the decade in which the Unix operating system (which first used this time representation) was invented.
Unix time is used widely in Unix-like and many other operating systems and file formats. Many Unix systems store epoch dates as a signed 32-bit integer, which might cause problems on January 19, 2038 (known as the Year 2038 problem or Y2038).
The unix time stamp is a way to track time as a running total of seconds. This count starts at the Unix Epoch on January 1st, 1970 at UTC. Therefore, the unix time stamp is merely the number of seconds between a particular date and the Unix Epoch. The time technically does not change no matter where you are located on the globe. This is very useful to computer systems for tracking and sorting dated information in dynamic and distributed applications both online and client side.
ISO 8601 is an international standard that governs the worldwide exchange and communication of date-related and time-related data.
The goal of ISO 8601 is to offer a well-defined, clear manner of representing calendar dates and times in global communications, particularly to avoid misinterpretations of numeric dates and times when data is moved across countries.
In ISO 8601, time zones are expressed as local time (without specifying the place), UTC, or an offset from UTC.
If the time is in UTC, add a Z without a space after the time. The zero UTC offset is designated by the letter Z.
As a result, "09:30 UTC" is written as "09:30Z" or "T0930Z."
"14:45:15Z" or "T144515Z" would be the equivalent of "14:45:15 UTC."
The UTC offset is appended to the time in the same way that 'Z' was above, in the form ±[hh]:[mm], ±[hh][mm], or ±[hh].
RFC 2822 is an internet Message Format that is used to convey date and time in a consistent manner, such as in HTTP and email headers.
The truncated day of week, numerical date, three-letter month abbreviation, year, time, and time zone are all included in RFC 2822, which displays as 01 Jun 2016 14:31:46 -0700.
RFC 2822 is a date and time notation format defined in RFC 2822 (Internet Message Format).
Human Readable Time | Seconds |
---|---|
1 Hour | 3600 Seconds |
1 Day | 86400 Seconds |
1 Week | 604800 Seconds |
1 Month (30.44 days) | 2629743 Seconds |
1 Year (365.24 days) | 31556926 Seconds |
Date / Time | Unix Time |
January 1st, 1970 00:00:00 | 0 |
June 6th, 1983 00:00:00 | 423792000 |
June 6th, 1983 16:00:00 | 423849600 |
September 9, 2001 1:46:40 | 1000000000 |
July 20th, 1969 20:17:40 | -14182940 |
Pre-1970 Timestamps The Unix epoch is January 1st, 1970 00:00:00 UTC; hence any timestamp before 1970 must be written as a negative number denoting the number of seconds until that day. For example, 1957-10-04T00:00:00Z, 4,472 days before the epoch, is represented by the Unix time number −4,472 × 86,400 = −386380800.
let Dec31_1969 = new Date(-24 * 3600 * 1000);
alert( Dec31_1969 );
How to get the current timestamp in some popular coding languages.
C#
|
Erlang
|
Go
|
Groovy
|
Java
|
JavaScript
|
Lua
|
MySQL
|
Objective-C
|
PHP
|
Python
|
Ruby
|
Shell
|
SQLite
|
Swift
|
When debugging, novices insert corrective code; experts remove defective code.
…