Created
November 5, 2020 17:45
-
-
Save zerobugs-oficial/6e1c59a2800cd0a535c9176b11bc4516 to your computer and use it in GitHub Desktop.
Converter data no padrão americano para o brasileiro usando Javascript
This file contains hidden or 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
let data_americana = "2020-12-30"; | |
let data_brasileira = data_americana.split('-').reverse().join('/'); | |
// Pronto! A data foi convertida. | |
console.log(data_brasileira); // retorna: 30/12/2020 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment