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.
データベースの DATETIME に保存するために、DOMTimeStampを PHP のGeolocationから変換したいと考えています。どうすればこれを達成できますか?
ミリ秒単位の単なるタイムスタンプです。それを秒に変換してから、PHP の組み込みの日付/時刻機能を使用して変換します。
$timestamp = floor($domtimestamp / 1000); // Get seconds from milliseconds $datetime = new DateTime('@'.$timestamp); echo $datetime->format('Y-m-d H:i:s');