Last active
March 14, 2017 15:59
-
-
Save AlexanderArmua/3d0ce1795bb46efadee11ebb145d9daa to your computer and use it in GitHub Desktop.
Get dd/mm/yyyy from epoch / Obtener dd/mm/yyyy de un epoch
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
getDateFromEpoch(timeEpoch) { | |
// date = dd/mm/yyyy, hh:mm. | |
var date = new Date(timeEpoch).toLocaleString("en-GB").toString(); | |
// with substr the return = dd/mm/yyyy | |
return date.substr(0, fecha.indexOf(",")); | |
} | |
/* | |
Documentation about toLocaleString(): https://developer.mozilla.org/es/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment