Problems working with DateFormat

Any idea why I am getting the following error:
java.text.ParseException: Unparseable date: "2011-09-21T22:30:00Z"

Here is the code snippet:
          String currentTime = "2011-09-21T22:30:00Z"
          DateFormat dfm = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
          try {
             long a = dfm.parse(currentTime).getTime();
          } catch (Exception e) {
Who is Participating?
CPColinConnect With a Mentor Senior Java ArchitectCommented:
Looks like it's the "Z" in the format string. If you put single quotes around that, like with the "T", it works.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.