Date.getGMTOffset

Syntax

PP.Date.getGMTOffset(date, colon): String;

Parameters

date. Date. Date

colon. Boolean. Indicates whether an hour-minute separator should be added (colon). Optional parameter, by default it is set to False.

Description

The getGMTOffset static method returns offset from Greenwich meantime.

Example

To execute the example, add a link to PP.js scenario file to HTML page.

// Create the current date
date = new Date();
// Get offset from Greenwich meantime
newDate = PP.Date.getGMTOffset(date, true);
console.log(newDate); // -> +05:00

After executing the example the offset from Greenwich meantime is obtained.

See also:

PP