Pretty datetime output from PHP and SQL

Pretty datetime output from PHP and SQL

I often find it a headache to remember how best to be formatting datetime coming into and out of php/sql setups especially when outputting it via JSON to be rendered in javascript-based frontends.

This is how I do it.

datetime coming out of an SQL DB in the format of “2009-12-02 20:52:50”

Leave a Reply

Your email address will not be published. Required fields are marked *