Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created January 27, 2023 17:46
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
const formateadorFechasRelativas = new Intl.RelativeTimeFormat('en-US', { style: 'long', });
const lanzamientoRE4 = new Date("2023-03-24T00:00:00");
const ahora = new Date();
const diferenciaEnMilisegundos = lanzamientoRE4.getTime() - ahora.getTime();
const diferenciaEnDias = diferenciaEnMilisegundos/1000/60/60/24;
formateadorFechasRelativas.format(diferenciaEnDias, 'day');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment