[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

change format of php date to insert into mysql datetime

Posted on 2013-01-23
3
Medium Priority
?
749 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
  • 2
3 Comments
 
LVL 84

Accepted Solution

by:
Dave Baldwin earned 2000 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 84

Expert Comment

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

Featured Post

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

Question has a verified solution.

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

In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
In this article, I’ll talk about multi-threaded slave statistics printed in MySQL error log file.
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 …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses
Course of the Month19 days, 19 hours left to enroll

873 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