Here you can find the source of getCurrentUtcDate()
public static Date getCurrentUtcDate()
//package com.java2s; //License from project: Open Source License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; public class Main { static final String DATEFORMAT = "yyyy-MM-dd HH:mm:ss"; static final String UTC_TIMEZONE_CODE = "UTC"; public static Date getCurrentUtcDate() { SimpleDateFormat sdf = new SimpleDateFormat(DATEFORMAT); sdf.setTimeZone(TimeZone.getTimeZone(UTC_TIMEZONE_CODE)); String utcTime = sdf.format(new Date()); Date dateToReturn = null; SimpleDateFormat dateFormat = new SimpleDateFormat(DATEFORMAT); try {//from ww w . j a va 2 s . co m dateToReturn = dateFormat.parse(utcTime); } catch (ParseException e) { e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. } return dateToReturn; } }