Created
June 14, 2021 22:55
-
-
Save jasp402/89efb59853bc4a89e55942ed8d097a09 to your computer and use it in GitHub Desktop.
Tanformar numeros a fecha
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
//Input | |
let d = '210614164612'; | |
//Conver | |
let year = d.slice(0, 2); | |
let month = d.slice(2, 4); | |
let day = d.slice(4, 6); | |
let hour = d.slice(6, 8); | |
let min = d.slice(8, 10); | |
let sec = d.slice(10,12); | |
//out | |
let fecha = `${day}/${month}/20${year} ${hour}:${min}:${sec}`; | |
console.log(fecha); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment