A
A
Abay Tazhigaliev2016-01-30 08:57:19
PHP
Abay Tazhigaliev, 2016-01-30 08:57:19

How to make the date of articles in the format day, month, year?

My date is in year, month, day format. Must be done as shown in the photo.
7071d928e77a4c7c8463514d4ab2fadc.png

Answer the question

In order to leave comments, you need to log in

3 answer(s)
B
bears, 2016-01-30
@webcoderpro

procedural style

echo date_format(date_create('2016-05-18'), 'd.m.Y');
echo date('d.m.Y', strtotime('2016-05-18'));

OOP
echo (new \DateTime('2016-05-18'))->format('d.m.Y');

M
MdaUZH, 2016-01-30
@MdaUZH

date('dmY', time create);

A
Abay Tazhigaliev, 2016-01-30
@webcoderpro

The database type is DATE, <?php echo date('dmY', time create);?> throws an error!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question