Solved

PHP Date from Twitter to MySQL format

Posted on 2013-05-30
2
742 Views
Last Modified: 2013-06-05
Hi experts,

I have a date in this format coming from the Twitter API:
 "Wed Aug 29 17:12:58 +0000 2012"

How do I translate this into date format used in MySQL (YYYY-MM-DD)?

I don't need the timestamp, just a date for use in MySQL.

Thank you!
0
Comment
Question by:EffinGood
[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
2 Comments
 
LVL 110

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 39209610
Consider your local date and time settings.
http://www.laprbass.com/RAY_temp_effingood.php

<?php // RAY_temp_effingood.php
error_reporting(E_ALL);

$twd = 'Wed Aug 29 17:12:58 +0000 2012';
$twt = strtotime($twd);
$new = date('c', $twt);
var_dump($twd, $new);

Open in new window

HTH, ~Ray
0

Featured Post

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

Creating and Managing Databases with phpMyAdmin in cPanel.
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

717 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