Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

date format

Posted on 2010-09-07
6
Medium Priority
?
335 Views
Last Modified: 2012-05-10
2010-08-10 15:33:39.000

want
2010-08-10
0
Comment
Question by:rgb192
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 4

Accepted Solution

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

Assisted Solution

by:Ray Paseur
Ray Paseur earned 1000 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

971 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