Hier einige gängige Operationen und Beispiele
$currentDate = date('Y-m-d');
$currentTime = date('H:i:s');
echo "Current Date: $currentDate";
echo "Current Time: $currentTime";
$timestamp = strtotime('2023-07-09 14:30:00');
$formattedDateTime = date('Y-m-d H:i:s', $timestamp);
echo "Formatted Date and Time: $formattedDateTime";
$timestamp = strtotime('+1 day', strtotime('2023-07-09'));
$newDate = date('Y-m-d', $timestamp);
echo "New Date: $newDate";
date_default_timezone_set('America/New_York');
$currentDateTime = date('Y-m-d H:i:s');
echo "Current Date and Time (New York): $currentDateTime";
// DateTime Class PHP > 5.2
$date = new DateTime('2023-07-09');
$date->add(new DateInterval('P1D')); // Add 1 day
echo $date->format('Y-m-d');