Here you can find the source of toLocalTZ(Date time, TimeZone localTimeZone)
Parameter | Description |
---|---|
time | a parameter |
localTimeZone | a parameter |
public static Date toLocalTZ(Date time, TimeZone localTimeZone)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { /**//from w ww. ja v a 2 s. c om * * @param time * @param localTimeZone * @return */ public static Date toLocalTZ(Date time, TimeZone localTimeZone) { if (localTimeZone == null) { return time; } return new Date(time.getTime() + (localTimeZone.getRawOffset() - TimeZone.getDefault().getRawOffset())); } }