Skip to content

Instantly share code, notes, and snippets.

@kelvearagao
Last active November 26, 2015 19:21
Show Gist options
  • Save kelvearagao/2714129c19a64758dea5 to your computer and use it in GitHub Desktop.
Save kelvearagao/2714129c19a64758dea5 to your computer and use it in GitHub Desktop.
Conversor de data no formato EN para o formato BR.
<?php
/**
* Receives a date in the EN format (Y-m-d) and renturns in the BR format (d/m/Y).
*
* @param string $date - format 'Y-m-d'.
* @return string - format 'd/m/Y'.
*/
function dateFromEnToBr($date)
{
return date('d/m/Y', strtotime($date));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment