1
0
Fork 0
php-coding/10.test1.php

16 lines
628 B
PHP

<?php
//date_default_timezone_set("Asia/Shanghai");
echo date('H:i:s') . "<br>";
print_r(getdate()) ;
echo time() . "<br>";
$currentTime = mktime(12, 0, 0, 1, 1, 2024);
echo '给定时间戳对应的日期:' . date("Y-m-d", $currentTime) . "<br>";
echo '给定时间戳对应的时间:' . date("H:i:s", $currentTime) . "<br>";
echo 'Now:' . date('Y-m-d', time());
echo 'Next week:' . date('Y-m-d', time() + (7 * 24 * 60 * 60)) . "<br>";
var_dump(checkdate(12,24,2024));
echo '<br>';
echo strtotime('now').'<br>';
echo strtotime('21 May 2009').'<br>';
echo strtotime('+3 day').'<br>';
echo date('Y-m-d',strtotime('last sunday'));