1$today = date("F j, Y, g:i a"); // October 30, 2019, 10:42 pm
2$today = date("D M j G:i:s T Y"); // Wed Oct 30 22:42:18 UTC 2019
3$today = date("Y-m-d H:i:s"); // 2019-10-30 22:42:18(MySQL DATETIME format)
1strtotime("now");
2
3// strtotime is a function that will take a string parameter
4// that specifies a date, and returns a unix time stamp bassed
5// on that
6
7echo strtotime("2020-02-24");
8
9// prints: 1582502400
1# Current Time
2date_default_timezone_set("America/New_York");
3echo "The time is " . date("h:i:sa");
1
2<?php
3$nextWeek = time() + (7 * 24 * 60 * 60);
4 // 7 Tage; 24 Stunden; 60 Minuten; 60 Sekunden
5echo 'Jetzt: '. date('Y-m-d') ."\n";
6echo 'Naechste Woche: '. date('Y-m-d', $nextWeek) ."\n";
7// oder strtotime() verwenden:
8echo 'Naechste Woche: '. date('Y-m-d', strtotime('+1 week')) ."\n";
9?>
10
11