Date.prototype.format >= 0.1.4

Purpose

Format a date

Syntax

Date#format ( Stringpattern );


Parameters

pattern

Return values

String

Examples

See a complete list of characters on the date.format github page.

Here are some examples:

var a = new Date("2015-08-26T20:15:47.278Z");

a.format('Y-m-d');>>> "2015-08-26"

a.format('Y-m-d \\e\\s\\c\\a\\p\\e\\d');>>> "2015-08-26 escaped"

a.format('H:i');>>> "22:15"