TimeGMT
Syntax
TimeGMT(): FTODateReturn Value
Description
Example
// Get current GMT time
const gmtTime = this.api.TimeGMT();
console.log(`GMT time: ${gmtTime.toString()}`);
// Compare with local time
const localTime = this.api.TimeLocal();
console.log(`Local time: ${localTime.toString()}`);
// Calculate time difference
const diffInHours =
(localTime.getTime() - gmtTime.getTime()) / (1000 * 60 * 60);
console.log(`Time difference from GMT: ${diffInHours} hours`);
// Format GMT components
console.log(
`GMT Date: ${gmtTime.yearOf()}.${gmtTime.monthOf()}.${gmtTime.dayOfMonth()}`
);
console.log(
`GMT Time: ${gmtTime.hour()}:${gmtTime.minute()}:${gmtTime.second()}`
);Last updated