public static long toLocalDate ( TimeZone browserTZ , TimeZone targetTZ , Date utcDate ) { long utc = utcDate . getTime ( ) ; int targetOffsetFromUTC = targetTZ . getOffset ( utc ) ; int browserOffsetFromUTC = browserTZ . getOffset ( utc ) ; return utc + targetOffsetFromUTC - browserOffsetFromUTC ; }
convert from UTC to local date