The goog.i18n.DateTimeFormat Class

goog.i18n.DateTimeFormat(pattern)

Construct a DateTimeFormat object based on current locale.

pattern {string|number}
pattern specification or pattern type.

The goog.i18n.DateTimeFormat.Format Enum

Enum to identify predefined Date/Time format pattern. … more

.format(date, opt_timeZone)

Format the given date object according to preset pattern and current lcoale.

date {goog.date.DateLike}
The Date object that is being formatted.
opt_timeZone {goog.i18n.TimeZone=}
optional, if specified, time related fields will be formatted based on its setting. When this field is not specified, "undefined" will be pass around and those function that really need time zone service will create a default one.
returns {string}
Formatted string for the given date.