Is it possible to have JavaScript compute a timestamp returned from PHP’s time() function and present it in a readable format such as “Sun, 18th April 2010 at 4:00 pm”?
Is it possible to have JavaScript compute a timestamp returned from PHP’s time() function
Share
Use the Date object to do that:
You need to multiply the Unix timestamp by 1000 becuase
Dateexpects the timestamp to be in milliseconds.And to format the date, you can use this
Date.formatmethod (Date has none built in).