View Single Post
  #4 (permalink)  
Old 06-04-2010, 10:41 AM
saviourdlima saviourdlima is offline
Junior Member
 
Join Date: Apr 2010
Posts: 14
Default How to Convert a PHP String to Date?

I basicly want to take three inputs and make them into one date object.

Should I then combine them into one string first?

so would it be
$datestring= $year.$month.$day;

then

$time = strtotime( $datestring );

then
$myDate = date( 'y-m-d', $time ); ?
Reply With Quote