Here you can find the source of nowUTC()
public static Date nowUTC()
//package com.java2s; //License from project: Open Source License import java.util.Date; import java.util.TimeZone; public class Main { public static Date nowUTC() { Date dateTimeNow = new Date(); return localDateToUTC(dateTimeNow); }/* w w w . j av a 2 s . co m*/ 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); } }