Parse string date value input with "E, dd MMM yyyy HH:mm:ss Z" format in Java

Description

The following code shows how to parse string date value input with "E, dd MMM yyyy HH:mm:ss Z" format.

Example


//  w ww .  j a  v a2 s . c o m
import java.text.Format;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {
  public static void main(String[] argv) throws Exception {

    Format formatter = new SimpleDateFormat("E, dd MMM yyyy HH:mm:ss Z");
    Date date = (Date) formatter.parseObject("Tue, 29 Jan 2004 21:14:02 -0500");
  }
}




















Home »
  Java Tutorial »
    Date »




Date Get
Date Set
Date Format
Date Compare
Date Convert
Date Calculation
Date Parse
Timezone