Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
自分のタイムゾーンで現在の時刻を返すにはどうすればよいですか? それはあまりにも速く一日を返し続けます。土なのに日曜って言ってる。午後 6 時 30 分で、午前 1 時 30 分と言っています。どうすればこれを修正できますか?
デフォルトのタイムゾーンを設定しdate_default_timezone_set('UTC');、マニュアルを読んでください。
date_default_timezone_set('UTC');
例: UTC、GMT、大西洋/アゾレス諸島
このコードを日付関数で使用します
date('g:i:s', time()-18000);
time()-18000を使用すると修正されます 頑張ってください!