Advertisement
ZarTek-CREOLE

Untitled

Apr 4th, 2023
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const formatDateFr = (date) => {
  2.   const formatter = new Intl.DateTimeFormat('fr-FR', {
  3.     day: '2-digit',
  4.     month: 'long',
  5.     year: 'numeric',
  6.   });
  7.  
  8.   return formatter.format(date);
  9. };
  10.  
  11. // Exemple d'utilisation
  12. const datetime = new Date(); // Utilisez votre objet Date ici
  13. const dateFr = formatDateFr(datetime);
  14. console.log(dateFr);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement