Created
January 6, 2016 18:15
-
-
Save kelvearagao/87dd59958ca9fa22118a to your computer and use it in GitHub Desktop.
Função javascript para converter a data do formato brasileiro para formato inglês.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Recebe um data no formato dd/mm/yyyy e retorna yyyy-mm-dd. | |
* | |
* @param string date - Data no formato 'dd/mm/yyyy'. | |
* @return string - Data no formato 'yyyy-mm-dd'. | |
*/ | |
function dateToEN(date) | |
{ | |
return date.split('/').reverse().join('-'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
valeu mestre