When writing a post in the "date" column, the number obtained using the time () function is stored in the database. How, then, can we make the date form from this number and output in the required format?

    2 answers 2

    date("Ymd H:i:s",$timestamp_from_base) 
    • Thank! I thought it was impossible to insert just a number as a parameter :) - Garfild

    You can also format the database request immediately.

     SELECT date_format(`date_field`, '%Y-%m-%d %H:%i:%s') as `date_field` FROM `table`