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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:51:08+00:00 2026-06-04T15:51:08+00:00

JSR-310 has a handy class DateTimeFormatter which allows you to construct a DateTimeFormatter .

  • 0

JSR-310 has a handy class DateTimeFormatter which allows you to construct a DateTimeFormatter. I particularly like the pattern(String) method – see javadoc

However, I hit a problem whereby this is case sensitive — e.g.

DateTimeFormatters.pattern("dd-MMM-yyyy");

matches with "01-Jan-2012", but not with "01-JAN-2012" or "01-jan-2012".

One approach would be to break the string down and parse components, or another would be to use Regex to replace the case-insensitive strings with the case-sensitive string.

But it feels like there ought to be an easier way…

  • 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-04T15:51:09+00:00Added an answer on June 4, 2026 at 3:51 pm

    And there is… according to the User Guide (offline, see JavaDoc instead), you should use DateTimeFormatterBuilder to build a complex DateTimeFormatter

    e.g.

    DateTimeFormatterBuilder builder = new DateTimeFormatterBuilder();
    builder.parseCaseInsensitive();
    builder.appendPattern("dd-MMM-yyyy");
    DateTimeFormatter dateFormat = builder.toFormatter();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There's regex validation in JSR-303 (javax.validation). For example: @Pattern(regexp=[\w_\\.]+) private String username; The default
I'm writing a MIDlet which needs to write file. I'm using FileConnection from JSR-75
JSR-250 says all @Resource annotated methods will be called before the @PostConstruct method.. My
I wrote a custom JSR-196 module, which combines multiple mechanisms to protect resources. It
Studying JSR-299, I read section 5.1 of the Weld reference which explains how scopes
I came across https://blog.joda.org/2009/11/why-jsr-310-isn-joda-time_4941.html . 1) I am currently migrating Java Calendar to joda-time.
Given a JCR (Java content repository, implementing standards jsr-170 and/or jsr-283, like Apache Jackrabbit,
In the java world there is the bean validation framework JSR-303 which is a
I often see the frequent use of a JSR-XXX title when mentioning various aspects
How can the platformRequest method defined in MIDP 2.1 JSR be used to open

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.