Here you can find the source of buildTimezone(int hours, int minutes)
Parameter | Description |
---|---|
hours | the hour offset |
minutes | the minute offset |
public static TimeZone buildTimezone(int hours, int minutes)
//package com.java2s; import java.util.SimpleTimeZone; import java.util.TimeZone; public class Main { /**//from w w w.jav a2 s.c o m * Builds a timezone object with the given offset. * @param hours the hour offset * @param minutes the minute offset * @return the timezone object */ public static TimeZone buildTimezone(int hours, int minutes) { int hourMillis = 1000 * 60 * 60 * hours; int minuteMillis = 1000 * 60 * minutes; if (hours < 0) { minuteMillis *= -1; } return new SimpleTimeZone(hourMillis + minuteMillis, ""); } }