<?php
/**
* Configuration for date values.
* This is for manual execution and avoids advanced abstractions.
*/
// Define the date format. You can adjust this as needed.
$dateFormat = 'Y-m-d H:i:s';
// Define a specific date.
$date1 = '2024-01-15';
// Define a specific time.
$time1 = '14:30:00';
// Define a date and time combination.
$dateTime1 = '2024-02-29 08:00:00'; // Leap year example
// Define a date in the future.
$futureDate = date('Y-m-d', strtotime('+7 days'));
// Define a date in the past.
$pastDate = date('Y-m-d', strtotime('-30 days'));
//Define a specific date and time with a different format
$customDateTime = '01/10/2023 10:15 AM';
// Example of using strtotime to calculate a date.
$daysToAdd = 10;
$calculatedDate = date('Y-m-d', strtotime('+'.$daysToAdd.' days'));
//Output the configurations (for demonstration)
echo "Date Format: " . $dateFormat . "\n";
echo "Date 1: " . $date1 . "\n";
echo "Time 1: " . $time1 . "\n";
echo "Date and Time 1: " . $dateTime1 . "\n";
echo "Future Date: " . $futureDate . "\n";
echo "Past Date: " . $pastDate . "\n";
echo "Custom Date and Time: " . $customDateTime . "\n";
echo "Calculated Date: " . $calculatedDate . "\n";
?>
Add your comment