date format

2010-08-10 15:33:39.000

want
2010-08-10
LVL 1
rgb192Asked:
Who is Participating?
 
javaftperCommented:
$valueshort = substr($value, 0, 10);
0
 
Ian GoughCommented:
0
 
javaftperCommented:
date("Y-m-d");
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
rgb192Author Commented:
$value ="2010-08-10 15:33:39.000"

so what do I have to do to $value
0
 
Ray PaseurCommented:
The best and safest way is like this code snippet.

I have an article here at EE that may be useful to you.
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_201-Handling-date-and-time-in-PHP-and-MySQL.html

Best, ~Ray
$value ="2010-08-10 15:33:39.000"
$ymd = date('Y-m-d', strtotime($value));

Open in new window

0
 
rgb192Author Commented:
one answer was quick, another answer was 'safe'

thank you
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.