Hey, I am working on a script that will only allow some to login for the first 48hours that they sign up. In MYSQL it puts a timestamp "2005-08-18 14:43:32" and how I take that in to php and convert it so I can use it?
Yeah,
Here is how you convert the timestamp : $display_time = date("m-d-Y H:i:sa",$timefromdb); Here is how you can use it : http://us2.php.net/manual/en/function.time.php
Hope this helps, Chad
Well see i need to convert that in to a unix time stamp. Can i do that?
Take a look at [man]mktime[/man] and [man]strtotime[/man]
Get mysql to do all the work, you can get the field straight out as a unix timestamp with
SELECT UNIX_TIMESTAMP(yourdatefield) FROM wherever
Mysql's DATE_FORMAT will also let you kill two birds with bricks and all that
Nice didnt even look in to that i will have to check it out thanks for the hint 🙂
Drakla good find. I didn't even see that either. Way to go.