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
Solved

date format

Posted on 2010-09-07
6
323 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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 4

Accepted Solution

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

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying 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

Suggested Solutions

Title # Comments Views Activity
Checkout Page Input Field not aligned 1 26
mysql query for sum() 3 28
Uploading a CSV Data Import via PHP & MySql 3 33
Wordpress Only run code if on a certain page 11 23
Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
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.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

828 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