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.
Share
For JavaScript just create a new
Dateobject like thisand then you can construct your date in any format you want using the methods that
Dateprovides. See this reference for the complete list of methods you can use.In your case you could do something like this:
As for PHP it’s as simple as this:
See this page for full reference on the
Date()function.