Datetime issue when switching site language CakePHP 3

132 Views Asked by At

I'm working on a CakePHP 3 application and the problem that I'm having right now is that I'm using the PHP date function to display dates in format like "date month year" (for example: 12 Sept 2018) like so:

date('d M Y', strtotime(my_mysql_datetime));

but the problem is that it works when the website is in english, but when I change the website language to french for example, the datetime format also changes which results in strtotime returning false.

How can I prevent the datetime that I get from my database to change when I switch the website language?

0

There are 0 best solutions below