Solved

date format

Posted on 2010-09-07
6
321 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
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 
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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to count occurrences of each item in an array.
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 …

777 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