Get started with date-fns CDN

MIT licensed

Date-fns is a popular library for working with dates and times.

Tags:
  • date
  • helper

Stable version

Copied!

How to start using date-fns CDN


<!DOCTYPE html>
<html>
<head>
  <title>Get started with date-fns CDN - cdnhub.io</title>
  <script src="https://cdn.jsdelivr.net/npm/date-fns@3.5.0/esm/date_fns.min.js"></script>
</head>
<body>
  <script>
    import { format } from 'date-fns';

    const now = new Date();
    const formattedDate = format(now, 'dd MMM yyyy HH:mm:ss');

    console.log(formattedDate);
  </script>
</body>
</html>

All versions