JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 100
  • Score
    100M100P100Q72295F
  • License ISC

Takes a string and a date object, returns what you expect

Package Exports

  • format-date

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (format-date) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

format-date

Forked from http://github.com/azer/format-date and republished.

Takes a string and a date object, returns what you expect.

Install

$ npm install format-date

Example

var formatDate = require('format-date');

formatDate('{month}/{day}/{year}', new Date());
// 21/09/2014

formatDate('{hours}:{minutes}:{seconds} {day-name}', new Date());
// 13:30:53 Monday

formatDate('{month-name} {year}', new Date());
// January 2014

Reference

Local

  • day
  • day-name
  • month
  • month-name
  • year
  • hours
  • minutes
  • seconds

UTC

  • utc-day
  • utc-day-name
  • utc-month
  • utc-month-name
  • utc-year
  • utc-hours
  • utc-minutes
  • utc-seconds