doctype [?]
[strict] [loose] [none]

Date Formatting And Format Validation

This library contains functions to deal with dates in Javascript, parse date strings, format dates to different output strings, and compare dates.

It uses the same format strings as the java.text.SimpleDateFormat class, with a few minor exceptions.

Formatting Examples

Using the current date and time, the table below shows output for different format strings.

Format String Output
MMM dd, yyyy
hh:mm a
NNN yyyy