1 | time()
sekunder siden 01-01-1970 |
1656377336 |
2 | dags dato | 2022 |
3 | dags dato vha time() | 28-06-2022 0:48:56 |
4 | tids soner | The time in UTC is 00:48:56 The time in Asia/Calcutta is 06:18:56 The time in Europe/Copenhagen is 02:48:56 |
5 | årets dagnummer (dd) | 178 |
6 | date("l", mktime(0,0,0,3,20,1941)
dag dag nummer i året dato |
Thursday 83 25 03 2021 |
7 | $date = date_create();
echo date_timestamp_get($date); |
1656377336 |
8 | (0,0,0,3,20,1970) | 78 |
9 | (0,0,0,3,20,1972) | 79 |
10 | date(m.y*10000+m.m*100+m.d)
y=2021, m=3, d=20 (sql format, felttype:date) |
22 08 1970 20210320 1616194800 20 03 2021 |
11 | $dato = "23-02-2022 10:54:20";
$date=date_create($dato); $phpdato = date_format($date,"Y-m-d G:i:s"); |
2022-02-23 10:54:20 1645610060 |
12 |
$dt = strtotime("2012-12-21 22:15:16"); echo date("Y-m-d", strtotime("+1 month", $dt))."\n"; |
2013-01-21 22:15:16 |
13 |
$dt = strtotime("21-12-2012 22:15:16"); echo date("Y-m-d", strtotime("+1 month", $dt))."\n"; |
21-12-2013 22:15:16 |
14 |
$dt = "21-12-2012 22:15:16"; echo date("d-m-Y G:i:s", strtotime("+1 year", strtotime($dt))); |
21-12-2013 22:15:16 |