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 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 PHP Tutorial 8 min read BasicsPHP Syntax 4 min read PHP Variables 5 min read PHP | Functions 8 min read PHP Loops 4 min read ArrayPHP Arrays 5 min read PHP Associative Arrays 4 min read Multidimensional arrays in PHP 5 min read Sorting Arrays in PHP 4 min read OOPs & InterfacesPHP Classes 2 min read PHP | Constructors and Destructors 5 min read PHP Access Modifiers 4 min read Multiple Inheritance in PHP 4 min read MySQL DatabasePHP | MySQL Database Introduction 4 min read PHP Database connection 2 min read PHP | MySQL ( Creating Database ) 3 min read PHP | MySQL ( Creating Table ) 3 min read PHP AdvancePHP Superglobals 6 min read PHP | Regular Expressions 12 min read PHP Form Handling 4 min read PHP File Handling 4 min read PHP | Uploading File 3 min read PHP Cookies 9 min read PHP | Sessions 7 min read Like