php: NiceDate Helper Function

Helper function to convert mySql timestamps and date field values

phpinfo() Screenshot from php 5.3.2

To handle the repeating task of parsing a mysql timestamp or date field in different styles I created a
php function to help me with this task.

Update 2020

Since this is quite an old blog post, I would now advise to use the native DateTime class from php or the wonderful PHP library Carbon.

Good to Know

Converting timestamps or dates also works while querying a mySql database see the Functions and Operators mySql documentation for more information.