strftime support for date-fns

View on GitHub


Package Version Dependency Status Build Status Coverage Status

strftime support for date-fns


date-fns provides the most comprehensive, yet simple and consistent toolset for manipulating JavaScript dates in a browser & Node.js.

Unfortunately, the library doesn't support one of the most common approaches to format strings: the Unix-Style strftime syntax.

This plugin aims to fill the gap by reusing internally the format function of date-fns.

Installation (NPM)

Simply do:

npm install date-fns-strftime

Installation (Bower)

Simply do:

bower install date-fns-strftime


const strftime = require("date-fns-strftime");

strftime(new Date(), "%m/%d/%y %I:%M %p %Z"); // => "17/01/21 09:17 AM CET"

Supported modifiers

This plugin supports all modifiers listed here with the exception of the following:

And with the addition of the following modifiers:

Supported implementations.

date-fns-strftime supports and has been tested on NodeJS 6.0+.

API Documentation

The API documentation can be found here.

Contributing to date-fns-strftime


Copyright (C) 2017 and above Shogun

Licensed under the MIT license, which can be found at

Your browser is obsolete. For the best browsing experience, update it for free by visiting BrowseHappy.
There is a shiny new version. Update now!
Made by a proud Italian!