I have a date in a textbox ..
$myDate ='06/30/2014'
how do i convert it into this format..since this is the date format in the database..
$myDate ='2014-06-30'
thanks..
I have a date in a textbox ..
$myDate ='06/30/2014'
how do i convert it into this format..since this is the date format in the database..
$myDate ='2014-06-30'
thanks..
We use explode fuction with seperator / , so it will give you array of size 3, then you can concate it as shown below
$datearr=explode("/",$myDate);
$dbdate=$datearr[2]."-".$datearr[0]."-".$datearr[1];
OR...
$dbDate = date('Y-m-j', strtotime($myDate));
Thank you..
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.