Here you can find the source of utcToDate(String utcTimestamp)
public static Date utcToDate(String utcTimestamp) throws ParseException
//package com.java2s; /**//from w ww .jav a2 s .c om * Copyright (c) 2009 University of Rochester * * This program is free software; you can redistribute it and/or modify it under the terms of the MIT/X11 license. The text of the * license can be found at http://www.opensource.org/licenses/mit-license.php and copy of the license can be found on the project * website http://www.extensiblecatalog.org/. * */ import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; public class Main { public static Date utcToDate(String utcTimestamp) throws ParseException { SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ"); df.setTimeZone(TimeZone.getTimeZone("GMT")); Date d = df.parse(utcTimestamp.replaceFirst("Z$", "+0000")); return d; } }