🌐
date-fns
date-fns.org › docs › Getting-Started
date-fns - modern JavaScript date utility library
date-fns provides the most comprehensive yet simple and consistent toolset for manipulating JavaScript dates in a browser & Node.js.
🌐
DevDocs
devdocs.io › date_fns
DevDocs — date-fns documentation
date-fns 2.29.2 API documentation with instant search, offline support, keyboard shortcuts, mobile version, and more.
🌐
GitHub
github.com › date-fns › date-fns
GitHub - date-fns/date-fns: ⏳ Modern JavaScript date utility library ⌛️
import { compareAsc, format } from "date-fns"; format(new Date(2014, 1, 11), "yyyy-MM-dd"); //=> '2014-02-11' const dates = [ new Date(1995, 6, 2), new Date(1987, 1, 11), new Date(1989, 6, 10), ]; dates.sort(compareAsc); //=> [ // Wed Feb 11 1987 00:00:00, // Mon Jul 10 1989 00:00:00, // Sun Jul 02 1995 00:00:00 // ]
Starred by 36.5K users
Forked by 1.9K users
Languages   TypeScript
🌐
npm
npmjs.com › package › date-fns
date-fns - npm
import { compareAsc, format } from "date-fns"; format(new Date(2014, 1, 11), "yyyy-MM-dd"); //=> '2014-02-11' const dates = [ new Date(1995, 6, 2), new Date(1987, 1, 11), new Date(1989, 6, 10), ]; dates.sort(compareAsc); //=> [ // Wed Feb 11 1987 00:00:00, // Mon Jul 10 1989 00:00:00, // Sun Jul 02 1995 00:00:00 // ]
      » npm install date-fns
    
Published   Sep 17, 2024
Version   4.1.0
🌐
date-fns
date-fns.org › docs
date-fns docs
date-fns provides the most comprehensive yet simple and consistent toolset for manipulating JavaScript dates in a browser & Node.js.
🌐
GitHub
github.com › date-fns › docs
GitHub - date-fns/docs: date-fns documentation utilities · GitHub
This library is used to load docs into the database and provide a schema for the website. The package is integrated into the date-fns build and release scripts, but if you need to run it manually, use the following instructions:
Author   date-fns
🌐
npm
npmjs.com › package › @date-fns › docs
date-fns/docs
date-fns documentation utilities & types. Latest version: 0.38.0, last published: a year ago. Start using @date-fns/docs in your project by running `npm i @date-fns/docs`. There are 0 other projects in the npm registry using @date-fns/docs.
      » npm install @date-fns/docs
    
Published   Sep 16, 2024
Version   0.38.0
Author   Sasha Koss
🌐
GitHub
github.com › date-fns › date-fns › blob › main › docs › fp.md
date-fns/docs/fp.md at main · date-fns/date-fns
import { addYears, formatWithOptions } from "date-fns/fp"; import { eo } from "date-fns/locale"; import toUpper from "lodash/fp/toUpper"; // 'date-fns/fp' is compatible with 'lodash/fp'! // If FP function has not received enough arguments, it returns another function const addFiveYears = addYears(5); // Several arguments can be curried at once const dateToString = formatWithOptions({ locale: eo }, "d MMMM yyyy"); const dates = [ new Date(2017, 0 /* Jan */, 1), new Date(2017, 1 /* Feb */, 11), new Date(2017, 6 /* Jul */, 2), ]; const formattedDates = dates.map(addFiveYears).map(dateToString).map(toUpper); //=> ['1 JANUARO 2022', '11 FEBRUARO 2022', '2 JULIO 2022']
Author   date-fns
🌐
DigitalOcean
digitalocean.com › community › tutorials › js-date-fns
Quick Tour of date-fns, a Simple JavaScript Date Library | DigitalOcean
March 18, 2020 - date-fns seems to be getting a lot more development work than Moment.js at the moment 😉. For this reason, it’s really well-maintained, and developers get more input into its direction. Along with its robust feature set and modern ES6 sensibilities, it’s worth giving it a try! 📅📌 · The official docs for date-fns are really great, and have lots of code samples!
Find elsewhere
🌐
GitHub
github.com › date-fns › date-fns › blob › main › docs › timeZones.md
date-fns/docs/timeZones.md at main · date-fns/date-fns
Starting from v4, date-fns has first-class support for time zones. It is provided via @date-fns/tz and @date-fns/utc packages.
Author   date-fns
🌐
GitHub
github.com › date-fns › date-fns › blob › main › docs › i18n.md
date-fns/docs/i18n.md at main · date-fns/date-fns
// app/_lib/format.js import { format } from "date-fns"; import { enGB, eo, ru } from "date-fns/locale"; const locales = { enGB, eo, ru }; // by providing a default string of 'PP' or any of its variants for `formatStr` // it will format dates in whichever way is appropriate to the locale export default function (date, formatStr = "PP") { return format(date, formatStr, { locale: locales[window.__localeId__], // or global.__localeId__ }); } // Later: import format from "app/_lib/format"; window.__localeId__ = "enGB"; format(friday13, "EEEE d"); //=> 'Friday 13' window.__localeId__ = "eo"; format(friday13, "EEEE d"); //=> 'vendredo 13' // If the format string is omitted, it will take the default for the locale.
Author   date-fns
🌐
GitHub
github.com › date-fns › date-fns › blob › main › docs › gettingStarted.md
date-fns/docs/gettingStarted.md at main · date-fns/date-fns
import { format, compareAsc } from "date-fns"; format(new Date(2014, 1, 11), "MM/dd/yyyy"); //=> '02/11/2014' const dates = [ new Date(1995, 6, 2), new Date(1987, 1, 11), new Date(1989, 6, 10), ]; dates.sort(compareAsc); //=> [ // Wed Feb 11 1987 00:00:00, // Mon Jul 10 1989 00:00:00, // Sun Jul 02 1995 00:00:00 // ]
Author   date-fns
🌐
Yarn
classic.yarnpkg.com › en › package › date-fns
date-fns
Important: This documentation covers Yarn 1 (Classic).
🌐
Yarn
yarnpkg.com › package
date-fns | Yarn - Package Manager
Yarn is a package manager that doubles down as project manager. Whether you work on simple projects or industry monorepos, whether you're an open source developer or an enterprise user, Yarn has your back · First package manager built specifically around workspaces, Yarn lets you split your ...
🌐
Medium
jonathanx111.medium.com › a-date-fns-guide-for-your-next-react-project-2a333144fe90
A Date-Fns Guide for your next React Project | by Jonathan XIao | Medium
January 28, 2021 - Date-fns has amazing documentation. So let’s say you wanted to add 3 months as well. You go to the docs and search “add”, and you will see all the options for add(addHours, addMonths, addMinutes….).
🌐
Five9
documentation.five9.com › bundle › studio-combo › page › studio-build › content-types › function-date-fns.htm
JavaScript date-fns with Studio
October 16, 2025 - Skip to main contentSkip to search · Powered by Zoomin Software. For more details please contactZoomin · © 2026 Five9, Inc. All Rights Reserved · Privacy PolicyTerms of Use · Powered By
🌐
SitePoint
sitepoint.com › blog › javascript › managing dates and times in javascript using date-fns
Managing Dates and Times in JavaScript Using date-fns — SitePoint
November 13, 2024 - If you look inside the date-fns folder, you will see lots more folders and files. Don’t worry though, we won’t be shipping much of this to the client. We’ll only be selecting the functions we need and then running everything through parcel to make a minified and tree shaken bundle. Now create two files, index.html and index.js. <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <title>date-fns</title> </head> <body> <script src="index.js"></script> </body> </html>