Here you can find the source of parse(String source)
Parameter | Description |
---|---|
source | a parameter |
public static Date parse(String source)
//package com.java2s; /*//ww w . j a v a 2 s . c om * $RCSfile: GMTUtil.java,v $$ * $Revision: 1.1 $ * $Date: 2007-5-29 $ * * Copyright (C) 2008 Skin, Inc. All rights reserved. * * This software is the proprietary information of Skin, Inc. * Use is subject to license terms. */ import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; import java.util.TimeZone; public class Main { private static String DATE_FORMAT_GMT = "EEE, dd MMM yyyy HH:mm:ss z"; private static Locale local = Locale.ENGLISH; private static TimeZone timeZone = TimeZone.getTimeZone("GMT"); /** * @param source * @return Date */ public static Date parse(String source) { Date date = null; try { DateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT_GMT, local); dateFormat.setTimeZone(timeZone); date = dateFormat.parse(source); } catch (Exception e) { e.printStackTrace(); } return date; } }