Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7977745
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:17:41+00:00 2026-06-04T09:17:41+00:00

How can I parse this date format Mon May 14 2010 00:00:00 GMT+0100 (Afr.

  • 0

How can I parse this date format Mon May 14 2010 00:00:00 GMT+0100 (Afr. centrale Ouest) to this date format 05-14-2010 I mean mm-dd-yyyy

it’s telling me this error :

java.text.ParseException: Unparseable date: "Mon May 14 2010 00:00:00 GMT+0100 (Afr. centrale Ouest)"

EDIT

SimpleDateFormat formatter = new SimpleDateFormat("M-d-yyyy");
newFirstDate = formatter.parse(""+vo.getFirstDate());  //here the error

Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T09:17:44+00:00Added an answer on June 4, 2026 at 9:17 am

    This code first adapts the string a bit and then goes on to parse it. It respects the timezone, just removes “GMT” because that’s how SimpleDateFormat likes it.

    final String date = "Mon May 14 2010 00:00:00 GMT+0100 (Afr. centrale Ouest)"
      .replaceFirst("GMT", "");
    System.out.println(
        new SimpleDateFormat("MM-dd-yyyy").format(
            new SimpleDateFormat("EEE MMM dd yyyy HH:mm:ss Z").parse(date)));
    

    Prints:

    05-14-2010
    

    Bear in mind that the output is also timezone-sensitive. The instant defined by your input string is being interpreted in my timezone as belonging to the date that the program printed. If you just need to transform “May 14 2010” into “05-14-2010”, that’s another story and SimpleDateFormat is not well suited for that. The JodaTime library would handle that case much more cleanly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The date in dateTime.tz format looks like this: 2010-07-21T314:20:5.390Z How can I parse such
How can I parse this date format that my web service is receiving in
Is there any tool that can parse/conver xml files to this format? I have
I'm validating a user-entered date string in YYYY-MM-DD format using Zend_Validate::is($value,'Date') . This call
How can I parse JSON dates with GSON? Keeps getting errors. The date format
Can not parse json using this var res = eval('(' + response + ')');
How can I parse URL queries with a system like this. For Example something
This is only tangentially a programming question. Where can I find a simple-to-parse list
I want to parse the following date format to a DateTime object in C#.
I have a database field where date is stored as DD/MM/YYYY format. Now what

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.