I would like to get the current date/time stamp of the server or client in ISO8601 format (ex. 31 Dec 2009, 02:53). I know that server time can be observed using PHP and brought into the DOM using jQuery $.getJson. Client side time can be recorded from the browser using javascript/jQuery. I want the time stamp to be static (not dynamic/real-time). Im php/JS newbie and would greatly appreciate your help. Thanks.
What is UTC Time in ISO-8601 Format? Current time: 13:28:38 UTC.
ISO 8601: It is a representation of dates to keep an international standard and avoid difficulties when handling dates and time. UTC: It is the official time standard to synchronize the clocks and keep precision in measurements and other activities.
ISO 8601 represents date and time by starting with the year, followed by the month, the day, the hour, the minutes, seconds and milliseconds. For example, 2020-07-10 15:00:00.000, represents the 10th of July 2020 at 3 p.m. (in local time as there is no time zone offset specified—more on that below).
(GMT-5:00) Eastern Time (US & Canada)Add the local time offset to the UTC time. For example, if your local time offset is -5:00, and if the UTC time is shown as 11:00, add -5 to 11. The time setting when adjusted for offset is 06:00 (6:00 A.M.). Note The date also follows UTC format.
In PHP 5, you can do
date("c"); // ISO 8601 date (added in PHP 5)
see date
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With