Date Conversion PHP

Convert 1/1/2011 into 2011-01-01 00:00:00

PHP

$date = "1/1/2011";
$custom_insdate = date('Y-m-d H:i:s', strtotime($date));

Demo

Welcome

This is my test area for webdev. I keep a collection of code snippits here, mostly for my reference. Also if i find a good site, i usually add it here.

❤👩‍💻🕹