Last active
October 30, 2021 23:12
-
-
Save lucianobragaweb/a52ca3069752f1a124b6735e0d4c27f9 to your computer and use it in GitHub Desktop.
Converter data em formato americano para Brasileiro
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
function dateToBr(date) { | |
let splited = date.split('T') | |
let splitedDate = splited[0].split('-').reverse().join('/') | |
let hour = splited[1] | |
return `${splitedDate} ${hour}` | |
} | |
console.log(dateToBr('2021-10-21T05:51:03')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment