Search code examples
phpdatedate-formatdate-conversion

How to convert this date format "Sun Jul 13 2014 00:30:00 GMT+0530 (India Standard Time)" into a standard format "YYYY-m-d" using php


How to convert date format Sun Jul 13 2014 00:30:00 GMT+0530 (India Standard Time) to "YYYY-m-d"?


Solution

  • You could use strftime and strtotime functions like this:

    strftime("%Y-%m-%d", strtotime("Sun Jul 13 2014 00:30:00 GMT+0530"))