Unix Timestamp Converter (The Javascript Online Tool)
Unix Timestamp represents the number of seconds since 1st Jan, 1970 (00:00:00: GMT). It has been used widely in many Operating System.
Unix TimeStamp Converter Application Programming Interface (API)
We provide a simple API to allow easy conversion between the unix timestamp and the date string (formatted as "Y-m-d h:i:s").
To Convert From Date String to Unix TimeStamp
API example: https://helloacm.com/api/unix-timestamp-converter/?cached&s=2016-01-01%202:3:22 returns: 1451613802
To Convert From Unix TimeStamp to Date String
API example: https://helloacm.com/api/unix-timestamp-converter/?cached&s=1451613802 returns: "2016-01-01 02:03:22"
Invalid Date String
API example: https://helloacm.com/api/unix-timestamp-converter/?cached&s=asdfasd returns: false
API Core Source Code in PHP
if (is_numeric($s)) { $data = date("Y-m-d h:i:s", (integer)$s); } else { $data = strtotime($s); }