Skip to main content

date

The date object provides functions for the creation and manipulation of JavaScript Date objects.

Methods

createDate

pb.date.createDate(dateStr, timeStr, opts)

Creates a date object given a date and time.

Returns: Date - Returns a Date object.

ParamTypeDescription
dateStrstringe.g. 2011-10-31
timeStrstringe.g. 12:00am or 1:00pm
optscreateDateOptionsAdditional options used to determine the returned date.

dateToUTCTimestamp

pb.date.dateToUTCTimestamp(dateObj)

Takes a date object and returns a UTC timestamp which represents the number of seconds since January 1, 1970.

Returns: number - UTC timestamp.

ParamTypeDescription
dateObjDateA JavaScript Date object.

dateToUTCString

pb.date.dateToUTCString(dateObj)

Takes a date object and returns a UTC date and time string.

Returns: string - - UTC date and time string - ex. "2011-10-31 12:00:00" (12pm on Halloween)

ParamTypeDescription
dateObjDateA JavaScript Date object.

dateToString

pb.date.dateToString(dateObj)

Takes a date object and returns a JSON object containing various date and time formats in local time.

Returns: Object - An object containing the supplied date in various formats.

ParamTypeDescription
dateObjDateA JavaScript Date object.

createDateOptions

Represents individual items that are displayed for a Submenu.

Properties

NameTypeDescription
[utc]booleanIf true, the passed in time will be treated as UTC time.