Solved

PHP Date from Twitter to MySQL format

Posted on 2013-05-30
2
734 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
  • 2
2 Comments
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 39209607
0
 
LVL 108

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
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…
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.

863 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now