javadatedate-formatsimpledateformat

Format particular date with T character


What is the correct form for parse this date?: 2015-05-29T00:00:00+02:00

DateFormat format = new SimpleDateFormat("yyyyy-mm-dd hh:mm:ss");
Date data = format.parse(dataValue);

Solution

  • Try with

    SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX");
    

    Notice that