Skip to content

Instantly share code, notes, and snippets.

@simonpioli
Last active December 16, 2015 16:49
Show Gist options
  • Save simonpioli/5466169 to your computer and use it in GitHub Desktop.
Save simonpioli/5466169 to your computer and use it in GitHub Desktop.
mySQL Date Format in PHP. Because I'm fed up of Googling it all the time!
<?php
//To mySQL Format
date("Y-m-d H:i:s", $datetime);
//Back to legible
date("d/m/Y", strtotime($datetime));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment