Here you can find the source of toUTCDate(String dateStr)
public static Date toUTCDate(String dateStr) throws ParseException
//package com.java2s; //License from project: Apache License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; import java.util.TimeZone; public class Main { public static final String TIME_ZONE_UTC_GMT = "+0000"; private static final String DATE_TIME_FORMAT = "EEE MMM dd HH:mm:ss ZZZZZ yyyy"; public static Date toUTCDate(String dateStr) throws ParseException { SimpleDateFormat format = new SimpleDateFormat(DATE_TIME_FORMAT, Locale.ENGLISH); format.setTimeZone(TimeZone.getTimeZone(TIME_ZONE_UTC_GMT)); return format.parse(dateStr); }//from w ww .j a v a 2 s .co m }