Created
December 28, 2018 22:18
-
-
Save itsalb3rt/7d0f9643b707ecf146d1aba544236324 to your computer and use it in GitHub Desktop.
obtener fecha y tiempo con javascript
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
/** | |
* Reotorna fecha en formato yyyy-mm-dd hh:ii:ss | |
**/ | |
function get_date_time(){ | |
let date = new Date().toISOString().slice(0, 10); | |
let time = new Date(); | |
let hours = time.getHours(); | |
let minutes = time.getMinutes(); | |
let seconds = time.getSeconds(); | |
return date + ' ' + hours + ':' + minutes + ':' + seconds; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment