Jump to content

PHP Changing Date to Timestamp Format


patsfans

Recommended Posts

(I think my post got moved because I didn't explain what I needed properly - so sorry mods if this seems like a duplicate)

 

I need to change a date to a timestamp format using a PHP function.

 

I need to take this:

 

$date = "August 18, 2002";

 

and then using php convert it to this automatically:

 

$newdate = "2002-08-18 00:00:00";

 

I've looked here:

http://www.php.net/manual/en/function.strptime.php

 

but it shows how to do the reverse of what I need.

 

Does anyone know how the correct PHP function to output it that way?

Link to comment
https://forums.phpfreaks.com/topic/203132-php-changing-date-to-timestamp-format/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.