Skip to content

Instantly share code, notes, and snippets.

@JorgeMadson
Last active June 26, 2019 14:13
Show Gist options
  • Save JorgeMadson/da25e9f529088292583fc582a2e11d71 to your computer and use it in GitHub Desktop.
Save JorgeMadson/da25e9f529088292583fc582a2e11d71 to your computer and use it in GitHub Desktop.
Devolve uma data e hora menos algumas horas atrás
/*
O 19 é a quantidade de horas atrás, só subistituir por outro valor.
*/
new Date(new Date().setHours(new Date().getHours() - 19)).toLocaleString("pt-BR")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment