Java tutorial
//package com.java2s; //License from project: Open Source License import java.util.Date; import java.util.TimeZone; public class Main { public static Date convertLocalToUTC(Date local) { Date now = new Date(System.currentTimeMillis()); Date result = new Date(local.getTime() - TimeZone.getDefault().getOffset(now.getTime())); return result; } }