ISO 8601 was published on 06/05/88 and most recently amended on 12/01/04.
2017-02-24T23:04:17Z
2017-02-24T23:04:17+00:00
1985-04-12T23:20:50.52Z
1996-12-19T16:39:57-08:00
Sun, 06 Nov 1994 08:49:37 GMT
number of seconds since midnight, 1 January 1970 (UTC)
1488024000
Fri Jul 14 04:40:00 CEST 2017
Avoid date formats not specifying time zone
2016-01-10 13:14:15
Programmers are not always aware of ISO 8601. Use it everywhere, UI can be an exception of this rule.
The ISO 8601 definition for week 01 is the week with the Gregorian year's first Thursday in it.
Criteria to identify leap year:
next year = year + 365 days
next year = year + 1 year
The calculation used to determine the calendar date of Easter
Check if your programming language has function for Easter date
Based on Earth's rotation
Based on Atomic time
Unix timestamp ignores leap seconds
Asia/Kolkata +05:30
Asia/Kathmandu +05:45
Time difference between Warsaw and Sydney
Date: 2017-02-25
Warsaw: UTC + 1
Sydney: UTC + 11
Difference: 10 hours
Date: 2017-03-27
Warsaw: UTC + 2
Sydney: UTC + 11
Difference: 9 hours
Date: 2017-04-03
Warsaw: UTC + 2
Sydney: UTC + 10
Difference: 8 hours
Date: 2017-10-02
Warsaw: UTC + 2
Sydney: UTC + 11
Difference: 9 hours
Date: 2017-10-30
Warsaw: UTC + 1
Sydney: UTC + 11
Difference: 10 hours
Australia/Lord_Howe +10:30
Australia/Lord_Howe +11:00 (DST)
Africa/Casablanca suspends DST for about a month (Ramadan)
DST in 2016 for Africa/Casablanca
from 2016-03-27 to 2016-06-05
from 2016-07-10 to 2016-10-30
start = now()
f()
end = start - now()
If you want to measure elapsed time use monotonic clock
If your code depends on time make it an input parameter
Instead of this:
function f()
{
$now = time();
// ...
}
Do this:
function f($time)
{
$now = $time;
// ...
}
In your application do not call system clock
interface Clock
{
public function now(): DateTimeImmutable;
}
class SystemClock
{
public function now(): DateTimeImmutable
{
return new DateTimeImmutable();
}
}