java - DateTime ParseException for date with offset -


How can I parse a date string such as 2014-04-25T01: 50: 00.000-06: 00? I'm using add datetime and tried to do something like this:

  public static string format date (date D) {simple data format mdyFormat = new SimpleDateFormat ("yyyy-MM-dd ' HH: mm: ss .00'0Z '"); String mdy = mdyformat.format (d); Return MDI; }   

However, the result is an error:

java.text.ParseException: ineffective date: "2014-04-25T01: 50: 00.000- 06 : 00 "

Try defining the format like this: date format mdyFormat = new simple data format ("yyyy-MM-dd'H'HH: mm: ssZ")

Comments

Popular posts from this blog

asp.net - Procedure or function "Procedure name" expects a parameter "Param name" which was not supplied occurs rarely -

c# - The item with identity 'Id' already exists in the metadata collection. Parameter name: item -

c++ - Redefined variable in the other module -