Skip to content

Instantly share code, notes, and snippets.

@goliver79
Created February 27, 2014 14:36
Show Gist options
  • Save goliver79/9251285 to your computer and use it in GitHub Desktop.
Save goliver79/9251285 to your computer and use it in GitHub Desktop.
[PHP] Convert date in MySQL format
<?php
$date = '22/02/2014';
$date = date( str_replace( "/", "-", $date ) );
$date = date("Y-m-d", strtotime( $date ) );
echo $date; //2014-02-22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment