Here you can find the source of global2Date(String str)
public static String global2Date(String str)
//package com.java2s; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class Main { public static String global2Date(String str) { SimpleDateFormat sdf = new SimpleDateFormat( "EEE MMM dd HH:mm:ss zzz yyyy", Locale.US); Date date = null;//from w w w . j a v a 2 s .c o m try { date = (Date) sdf.parse(str); } catch (ParseException e) { e.printStackTrace(); } String formatStr = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss") .format(date); System.out.println(formatStr); return formatStr; } }