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 8772321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:00:34+00:00 2026-06-13T18:00:34+00:00

I want to parse a DateTime using the joda library (in scala, but should

  • 0

I want to parse a DateTime using the joda library (in scala, but should be the same with java).

The source looks like

val dateParser = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss z")
val date = dateParser.parseDateTime("2012-08-28 15:35:00 CEST")

In Java this would look like

DateTimeFormatter dateParser = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss z");
DateTime date = dateParser.parseDateTime("2012-08-28 15:35:00 CEST");

Unfortunately this doesn’t work but throws an exception:

java.lang.IllegalArgumentException: Invalid format: "2012-08-28 15:35:00 CEST" is malformed at "CEST"

Why doesn’t this work? Of course I could ignore the “CEST” part and just parse the rest, but in the input “CEST” can be replaced by “CET” sometimes, so I don’t want to ignore it.

  • 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-13T18:00:35+00:00Added an answer on June 13, 2026 at 6:00 pm

    The issue is because CEST is a short zone name that is not unique. See the detailed discussion from DateTimeFormatter Bug parsing with general time zones in US Locale?

    You can use the latest version from github that should contain a fix, see this commit.

    You should be able to use DateTimeFormatterBuilder#appendTimeZoneShortName to add CEST as an alias for “America/Chicago” or to how you would like to interpret CEST.

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

Sidebar

Related Questions

I'm trying to save date (using C# official driver): val = DateTime.Parse(value).Date; //Here date
I want to parse an xml log file, using Java. The weird thing though
I want to parse a string that represent a DateTime in UTC format. My
I want to parse something like this: Hi [{tagname:content}] [{tag1:xnkudfdhkfujhkdjki diidfo now nested tag
I want to parse the xml file with dynamic content using DOM parser in
I want to parse a xml file using xquery in Ruby, I found this
I want to convert a time string say '12:05 PM' into a datetime using
We want our coders to NOT use DateTime.parse() . How can we block to
I want to parse the Twitter API created_at value(stored into a variable), which looks
I've made a little forum and I want parse the date on newest posts

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.