OllyBarca
OllyBarca

Reputation: 1531

Formatting date stored in phpmyadmin

I'm querying a database and echoing the "date" column using PHP.

The date is displaying as YYYY-MM-DD, as it is saved under the "date" data type.

Which function would be best suited to convert the date structure to "Sunday 25th May 2013"?

Upvotes: 0

Views: 3418

Answers (3)

Heberfa
Heberfa

Reputation: 441

I hope it helps you

$mydate = "2013-03-24";

$mytime = strtotime($mydate);

echo date("l jS \of F Y ",$mytime);

Upvotes: 1

Tamil Selvan C
Tamil Selvan C

Reputation: 20209

try

<?php
echo date("l jS F Y", strtotime($value));
?>

Upvotes: 1

Raphael Caixeta
Raphael Caixeta

Reputation: 7846

Here you go:

$phpmyadmindatevalue is the value from the date column in your database.

<?php 

   $date = date("l jS F Y", strtotime($phpmyadmindatevalue));
   echo $date;

?>

Upvotes: 1

Related Questions