| Forsøg |
unix time |
date("d-m-Y H:i:s",time)
|
$month = 2;
$day = 5;
$year = 2023;
$cdate = date("Ymd",mktime(1,1,1,$month,$day,$year));
|
1675558861
|
20230205
|
|
$repeat = 1;
$cdate = date("Ymd",strtotime("+$repeat days",strtotime($cdate))); |
1675728000
|
20230206
|
|
|
date_default_timezone_set("Europe/Copenhagen");
|
|
|
| time() |
unix time |
date("d-m-Y H:i:s",time)
|
| The time() function returns the current time in the number of seconds since the Unix Epoch (January 1 1970 00:00:00 GMT). |
| time() |
1795706832 |
26-11-2026 16:27:12
|
|
| date("streng",unix time) |
unix time |
date("d-m-Y H:i:s",time)
|
| date("d-m-Y H:i:s",time()) |
|
26-11-2026 16:27:12
|
| date("d-m-Y H:i:s") |
|
26-11-2026 16:27:12
|
|
| mktime(hour, minute, second, month, day, year, is_dst) |
unix time
|
date("d-m-Y H:i:s",time)
|
| mktime(1,1,1,3,20,1941)
|
-908413139 |
20-03-1941 01:01:01
|
| mktime(25,62,62,13,32,2020)
|
1612227782 |
02-02-2021 02:03:02
|
$dato = date("Y-m-d",time())
$dato1 = strtotime($dato)
|
1795647600
|
26-11-2026 00:00:00
|
$dato2 = strtotime("+1 day",strtotime($dato1))
$dato1 = strtotime($dato)
|
86400
|
02-01-1970 01:00:00
|
|
| strtotime("streng",unix time)
|
unix time
|
date("d-m-Y H:i:s",time)
|
|
strtotime("now")
|
1795706832 |
26-11-2026 16:27:12 |
|
strtotime("3 October 2005")
|
1128290400 |
03-10-2005 00:00:00 |
|
strtotime("+1 year",strtotime("3 October 2005"))
|
1159826400 |
03-10-2006 00:00:00 |
|
strtotime("+10 hours")
|
1795742832 |
27-11-2026 02:27:12 |
|
strtotime("+1 week")
|
1796311632 |
03-12-2026 16:27:12 |
|
strtotime("+1 month")
|
1798298832 |
26-12-2026 16:27:12 |
|
strtotime("+1 week 3 days 7 hours 5 seconds")
|
1796596037 |
06-12-2026 23:27:17 |
|
strtotime("next Monday")
|
1795993200 |
30-11-2026 00:00:00 |
|
strtotime("last Sunday")
|
1795302000 |
22-11-2026 00:00:00 |
|
strtotime("2022-11-27 12:30:45")
|
1669548645 |
27-11-2022 12:30:45 |
|
strtotime("27-11-2022 12:41:57")
|
1669549317 |
27-11-2022 12:41:57 |
|
strtotime("27-11-2022_12:41:57")
|
|
01-01-1970 01:00:00 |
|
strtotime("20221127")
|
1669503600 |
27-11-2022 00:00:00 |
|
strtotime("27-11-2022")
|
1669503600 |
27-11-2022 00:00:00 |
|
strtotime("27112022")
|
|
01-01-1970 01:00:00 |
|