Skip to content

Instantly share code, notes, and snippets.

Created January 27, 2023 17:50
  • 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
What would you like to do?
const formateadorFechasRelativas = new Intl.RelativeTimeFormat('en-US', { style: 'long', });
const lanzamientoRE4 = new Date("2022-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