Here you can find the source of localDateToUTC(Date dtLocal)
public static Date localDateToUTC(Date dtLocal)
//package com.java2s; //License from project: Open Source License import java.util.Date; import java.util.TimeZone; public class Main { public static Date localDateToUTC(Date dtLocal) { if (dtLocal == null) return null; TimeZone tz = TimeZone.getDefault(); int currentOffsetFromUTC = tz.getRawOffset() + (tz.inDaylightTime(dtLocal) ? tz.getDSTSavings() : 0); return new Date(dtLocal.getTime() - currentOffsetFromUTC); }//from w ww . j ava2s .c o m }