Class: SimpleDateFormat

ix.text. SimpleDateFormat

new SimpleDateFormat(format)

Class reflects nearly all parts of java.text.SimpleDateFormat
NOT supported symbols of jdk8 are:
L - Month in year (standalone form) e.g. "July"; "Jul"; "07"
z - Time zone e.g. "Pacific Standard Time"; "PST"; "GMT-08:00"
Z - Time zone e.g. "-0800"
X - Time zone e.g. "-08"; "-0800"; "-08:00"

Parameters:
Name Type Description
format String
Throws:
InvalidArgumentException

Methods

format(input) → {String}

Formats the date with the specified format to it's string-representation.

Parameters:
Name Type Argument Default Description
input Date <optional>
new Date(0)
Returns:
Type
String

parse(input, base, twoDigitYearStart) → {Date|Undefined}

Parses the given String to Date, if possible.

Parameters:
Name Type Argument Default Description
input String

A String, part of which should be parsed.

base Date <optional>
new Date(0)

The Date, which deliveres missing Date-Parts while parsing.

twoDigitYearStart Date <optional>
new Date() - 80 Years

During parsing, two digit years will be placed in the range startDate to startDate + 100 years.

Returns:
Type
Date | Undefined