Solved

PHP Date from Twitter to MySQL format

Posted on 2013-05-30
2
736 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 109

Expert Comment

by:Ray Paseur
ID: 39209607
0
 
LVL 109

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

Title # Comments Views Activity
PHP Installer 5 37
Is there a simpler dropbox system? 10 34
Complex SQL statement in VB.NET 7 31
Could you point a way to obtain a specifically  DateInterval Object value? 2 21
These days socially coordinated efforts have turned into a critical requirement for enterprises.
This article discusses four methods for overlaying images in a container on a web page
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 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…

840 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