Solved

change format of php date to insert into mysql datetime

Posted on 2013-01-23
3
739 Views
Last Modified: 2013-01-23
date is in this php format

Sat, 19 Jan 2013 22:37:46 -0500

how to use php to insert into mysql datetime column
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
  • 2
3 Comments
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 38812819
Try this.
echo date('Y-m-d H:i:s', strtotime('Sat, 19 Jan 2013 22:37:46 -0500'));

Open in new window


http://us1.php.net/manual/en/function.strtotime.php
http://us1.php.net/manual/en/function.date.php
0
 

Author Closing Comment

by:rgb192
ID: 38812906
date inserts into mysql now,
thank you
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 38813307
You're welcome.
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

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…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
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…

738 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