-7

I have attribut date_input in my database

etat_input : 2016-06-06

I would convert my date on format:

since :  06 june 2016

I try with :

<?php  echo $var['etat_input'];?>

but no result.

Martin antonsson
  • 121
  • 1
  • 4
  • 16
  • 5
    read about date function - http://php.net/manual/en/function.date.php – splash58 Jun 06 '16 at 11:16
  • 1
    You may want to read this and try before this question is put to hold: http://stackoverflow.com/questions/2167916/convert-one-date-format-into-another-in-php – Thamilhan Jun 06 '16 at 11:20

1 Answers1

3

First convert date_input to timestamp:

$timestamp = strtotime($var['etat_input']);

Now feed that $timestamp to date with proper format:

date('d M Y', $timestamp);

PHP Sandbox example

Justinas
  • 41,402
  • 5
  • 66
  • 96