PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
David222
Forum Newbie
Posts: 1 Joined: Fri Feb 05, 2010 3:59 pm
Post
by David222 » Fri Feb 05, 2010 4:05 pm
I am trying to convert a string to a date...
is this correct?
Code: Select all
$dob_d = $_POST['new_dd'];
$dob_m =$_POST['new_mm'];
$dob_y = $_POST['new_yyyy'];
$dob = date("$dob_y/$dob_m/$dob_d");
pickle
Briney Mod
Posts: 6445 Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:
Post
by pickle » Fri Feb 05, 2010 4:22 pm
No. Check the docs for what
date() actually does.
You probably want
strtotime()
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.