<?php
$today = new DateTime();
$event = new DateTime('2025-12-31 20:30');
$countdown = $today->diff($event);
$earlybird = new DateTime();
$interval = new DateInterval('P1M');
$earlybird->add($interval);
?>
<p><b>Today:</b><br>
<?= $today->format('Y-m-d, g:i a, D') ?>
<p><b>Countdown to event:</b><br>
<?= $countdown->format('%y years %m months %d days') ?>
</p>
<p><b>Earlybird by:</b><br>
<?= $earlybird->format('D d M Y, g:i a') ?>
</p>
'PHP' 카테고리의 다른 글
Updating data - article (0) | 2024.10.12 |
---|---|
Updating data - category (0) | 2024.10.12 |
getting data (0) | 2024.10.11 |
sql (0) | 2024.10.11 |
image file (0) | 2024.10.10 |
form (0) | 2024.10.10 |
내장함수, number, update (0) | 2024.10.10 |
object (0) | 2024.10.09 |