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

python - Writing Greek in matplotlib labels, titles -

c# - LINQ to Entities does not recognize the method 'Int32 IndexOf(System.String, System.StringComparison)' method -

Pygame memory leak with transform.flip -