TimeDaylightSavings
Syntax
TimeDaylightSavings(): numberReturn Value
Description
Example
// Get DST offset
const dstOffset = this.api.TimeDaylightSavings();
console.log(`DST offset: ${dstOffset} seconds`);
// Check if DST is in effect
const isDST = dstOffset > 0;
console.log(`DST is in effect: ${isDST}`);
// Get current time with DST adjustment
const currentTime = this.api.TimeCurrent();
const localTimeWithDST = this.api.createFTODate(
currentTime.getTime() + dstOffset * 1000
);
console.log(`Local time with DST: ${localTimeWithDST.toString()}`);
// Calculate total timezone offset including DST
const gmtOffset = this.api.TimeGMTOffset();
const totalOffset = gmtOffset + dstOffset;
console.log(`Total timezone offset: ${totalOffset} seconds`);Last updated