Skip to content

KAZOO Support Channels

This documentation is curated by 2600Hz as part of the KAZOO open source project. Join our community forums here for peer support. Only features in the docs.2600hz.com/supported space are included as part of our 2600Hz Support Services plan.

monster.util.gregorianToDate()#

Syntax#

monster.util.gregorianToDate(timestamp);

Parameters#

Key Description Type Default Required
timestamp Gregorian timestamp representing a date. Number true

Return value#

A Date instance.

Errors#

  • 'timestamp' is not a valid Number: timestamp is NaN or of a type other than Number

Description#

The monster.util.gregorianToDate() method converts a Gregorian timestamp into a Date instance.

To preserve legacy behavior, if timestamp is of type String the method will try to coerce it into a Number but it is not recommended to rely on this behavior.

Examples#

Convert a Gregorian timestamp into a Date instance#

var timestamp = 63113932800;

monster.util.gregorianToDate(timestamp);

// output: Sat Jan 01 2000 00:00:00 GMT-0800 (Pacific Standard Time)