Solved

date format

Posted on 2010-09-07
6
329 Views
Last Modified: 2012-05-10
2010-08-10 15:33:39.000

want
2010-08-10
0
Comment
Question by:rgb192
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 12

Expert Comment

by:Ian Gough
ID: 33621592
0
 
LVL 4

Expert Comment

by:javaftper
ID: 33621613
date("Y-m-d");
0
 

Author Comment

by:rgb192
ID: 33621751
$value ="2010-08-10 15:33:39.000"

so what do I have to do to $value
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 4

Accepted Solution

by:
javaftper earned 250 total points
ID: 33621791
$valueshort = substr($value, 0, 10);
0
 
LVL 110

Assisted Solution

by:Ray Paseur
Ray Paseur earned 250 total points
ID: 33622017
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
 

Author Closing Comment

by:rgb192
ID: 33622105
one answer was quick, another answer was 'safe'

thank you
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question