Here you can find the source of getDateInUTC(String date)
public static Date getDateInUTC(String date) throws ParseException
//package com.java2s; //License from project: Apache License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.TimeZone; public class Main { public static Date getDateInUTC(String date) throws ParseException { return getCalendarInUTC(date).getTime(); }/* w w w. jav a 2 s . c om*/ public static Calendar getCalendarInUTC(String date) throws ParseException { Calendar calendar = Calendar.getInstance(TimeZone .getTimeZone("UTC")); SimpleDateFormat fromDateFormat = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss"); calendar.setTime(fromDateFormat.parse(date)); return calendar; } }