Sample date calculations
Today, tomorrow, yesterday and other date calculations
Copy this code and paste it in your HTML
Today:
<?php echo date('Y-m-d') ?> <br />
Tomorrow:
<?php echo date('Y-m-d', strtotime('+1 day')) ?> <br />
Yesterday:
<?php echo date('Y-m-d', strtotime('-1 day')) ?> <br />
1 week later:
<?php echo date('Y-m-d', strtotime('+1 week')) ?> <br />
1 month later:
<?php echo date('Y-m-d', strtotime('+1 month')) ?> <br />
// relative date
Report this snippet
Comments
Subscribe to comments