0

This date format 2016-04-21 is stored in the database, but it's display like 21.04.2014. on my website. This is very frustrating. Solution echo $object->field->format('Y-m-d'); is not good for me. I would like to define settings that this is not happening anymore. Sorry for my english.

user3661042
  • 167
  • 1
  • 13

1 Answers1

0

Use this

$date="2016-04-21";
$require_date_format = date('d.m.Y', strtotime($date));//will out put 21.04.2016
sradha
  • 2,216
  • 1
  • 28
  • 48
  • -1 The question is about CakePHP, its date/time objects, and a global, configurable solution. What you are showing here is the cumbersome variant of the `format()` call in the question. – ndm Apr 21 '16 at 08:51