📜  如何在 PHP 中获取当前日期和时间? - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:48.780000             🧑  作者: Mango

代码示例3
//Your Country Time Zone: https://www.php.net/manual/en/timezones.php

date_default_timezone_get(Asia/Dhaka);

$dateYmd = date('Y-m-d');
echo "Current Year Month Day: $dateYmd";
//Current Year Month Day: 2022-01-14

$datehms = date('h:i:s');
echo "Current Hour Minute Second: $datehms";
//Current Hour Minute Second: 10:33:58