Convert mysql date (datetime) to a more dated date format using php

I have a little php code that gets information from mysql database. The problem is that the date is in the format: "2010-02-03 22:21:26"

Does anyone know a simple solution to make the date more user friendly. eg,

 2nd march 2010 at 22:21. 
+4
source share
3 answers

See strtotime () and date ()

e.g. 2010-02-03 22:21:26 until 3rd February 2010 at 22:21 :

 $DateTimeStr = '2010-02-03 22:21:26'; echo date('jS FY \a\t G:i', strtotime($DateTimeStr)); 
+9
source
Function

date () will help you with this.

Sort of

 $date = date('j F, Y h:i:s', strtotime($date_value)); print $date; 

Format Options:

http://www.php.net/manual/en/function.date.php

+2
source
+2
source

Source: https://habr.com/ru/post/1305363/