strftime support for date-fns
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
npm install date-fns-strftime
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"
This plugin supports all modifiers listed here with the exception of the following:
And with the addition of the following modifiers:
%L: The milliseconds as decimal-number (range 000 to 999).
date-fns-strftime supports and has been tested on NodeJS 6.0+.
The API documentation can be found here.
Contributing to date-fns-strftime
- Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
- Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
- Fork the project.
- Start a feature/bugfix branch.
- Commit and push until you are happy with your contribution.
- Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
Copyright (C) 2017 and above Shogun firstname.lastname@example.org.
Licensed under the MIT license, which can be found at https://choosealicense.com/licenses/mit.