我来自孟加拉国。我没有从此代码中获得合适的时间吗?
<html>
<head>
<title>Server time</title>
</head>
<body>
<p>The time at the server is
<?php
print date('h:i:s A');
?>
</p>
</body>
</html>
输出是:
The time at the server is 08:58:51 PM
但实际时间是01:58:51 AM
始终使用date_default_timezone_set((在脚本中的正确时间在您的情况下,像这样的使用
<?php
date_default_timezone_set("Asia/Dhaka");
echo date_default_timezone_get();
?>