echo date('Y-m-d').'<br/ >';
echo strtotime(date('Y-m-d')).'<br/ >';
echo time().'<br />';
echo date("now");
echo "<hr>";
echo strtotime("now") . "<br />";
echo strtotime("tomorrow") . "<br />";
echo strtotime("yesterday") . "<br />";
echo strtotime("10 September 2000") . "<br />";
echo strtotime("+1 day") . "<br />";
echo strtotime("+1 week") . "<br />";
echo strtotime("+1 week 2 days 4 hours 2 seconds") . "<br />";
echo strtotime("next Thursday") . "<br />";
echo strtotime("last Monday") . "<br />";
echo strtotime("4pm + 2 Hours") . "<br />";
echo strtotime("now + 2 fortnights") . "<br />";
echo strtotime("last Monday") . "<br />";
echo strtotime("2pm yesterday") . "<br />";
echo strtotime("7am 12 days ago") . "<br />";
echo "<hr>";
$timestamp = time()-86400;
$date = strtotime("+7 day", $timestamp);
echo date('M d, Y', $date);
echo "<hr>";
$timestamp = time()-86400;
$date = strtotime("+1 month", $timestamp);
echo date('M d, Y', $date);
echo "<hr>";
$xmasDay = new DateTime('2010-12-24 + 1 day');
echo $xmasDay->format('Y-m-d'); // 2010-12-25
?>
url
http://stackoverflow.com/questions/3918646/add-day-to-current-date
http://stackoverflow.com/questions/11988428/return-current-date-plus-7-days
percobaan 2
<?php
$dayDate = date('Y-m-d');
$dayDate1 = date('d-M-Y', strtotime($dayDate));
echo "datetime sekarang = ".$dayDate;
echo "<br />";
echo "datetime sekarang = ".$dayDate1;
?>
ubah bulan 03 jadi may
hasil =
datetime sekarang = 2016-05-19
datetime sekarang = 19-May-2016
0 Response to "tambahkan waktu 1 bulan / 7 hari dari now()"
Posting Komentar