getTimezoneOffset

Summary

Returns the timezone offset in minutes from the host computer to Coordinated Universal Time (UTC).

Usage

public int getTimezoneOffset()

Returns

The timezone offset in minutes from the host computer to Coordinated Universal Time (UTC).

Description

Returns the timezone offset in minutes from the host computer to Coordinated Universal Time (UTC).

Examples

Basic Usage
1
2
3
4
import System;
 
Date d = new Date();
Console.log(d.getTimezoneOffset());
Get Timezone Offset in Hours
1
2
3
4
5
import System;
 
Date d = new Date();
double offset = d.getTimezoneOffset() / 60;
Console.log(offset);

Share

HTML | BBCode | Direct Link