How to convert a Date into Timestamp using PHP ? Last Updated : 23 Jul, 2025 Comments Improve Suggest changes Like Article Like Report The Task is to convert a Date to a timestamp using PHP. The task can be done by using the strtotime() function in PHP. It is used to convert English textual date-time description to a UNIX timestamp. The UNIX timestamp represents the number of seconds between a particular date and the Unix Epoch. Syntax: strtotime ($EnglishDateTime, $time_now) Example: PHP // PHP program to convert the date // to timestamp <?php $date = "2020-09-23"; $timestamp1 = strtotime($date); echo $timestamp1; echo "<br>"; $date2 = "24-09-2020"; $timestamp2 = strtotime($date2); echo $timestamp2; echo "<br>"; $date3 = "16 May 2019"; $timestamp3 = strtotime($date3); echo $timestamp3; ?> ?> Output: 160081920016009056001557964800 Create Quiz Comment M manaschhabra2 Follow 0 Improve M manaschhabra2 Follow 0 Improve Article Tags : Misc Web Technologies PHP PHP Programs PHP-date-time PHP-Misc +2 More Explore BasicsPHP Syntax4 min readPHP Variables5 min readPHP | Functions6 min readPHP Loops4 min readArrayPHP Arrays5 min readPHP Associative Arrays4 min readMultidimensional arrays in PHP5 min readSorting Arrays in PHP4 min readOOPs & InterfacesPHP Classes2 min readPHP | Constructors and Destructors5 min readPHP Access Modifiers4 min readMultiple Inheritance in PHP4 min readMySQL DatabasePHP | MySQL Database Introduction4 min readPHP Database connection2 min readPHP | MySQL ( Creating Database )3 min readPHP | MySQL ( Creating Table )3 min readPHP AdvancePHP Superglobals6 min readPHP | Regular Expressions12 min readPHP Form Handling4 min readPHP File Handling4 min readPHP | Uploading File3 min readPHP Cookies9 min readPHP | Sessions7 min read Like