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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T06:53:02+00:00 2026-05-18T06:53:02+00:00

I would like to be able to format java.util.Date objects in a long English,

  • 0

I would like to be able to format java.util.Date objects in a “long” English, Spanish, and German date format. By “long” I mean the locale-dependent date format that corresponds to the LONG style pattern constant in java.text.DateFormat:

DateFormat.getDateInstance(DateFormat.LONG, myLocale).format(myDate);

With a standard JRE, I get date strings like:

November 22, 2010
22 de noviembre de 2010
22. November 2010

as expected. On Android 1.5, however, I get:

November 22, 2010
2010 11 22
2010 11 22

Is there a way that I can include just enough locale information with my app to be able to format dates correctly in long English, Spanish, and German formats using java.text.DateFormat?

  • 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-05-18T06:53:03+00:00Added an answer on May 18, 2026 at 6:53 am

    First of all, the dates formatting in JRE is known for incorrect behavior for many locales (invalid Polish, Czech and Russian long dates, invalid Polish short date; And this are just examples of what I know for sure). So I wouldn’t trust this source of information much.

    If you want to implement your own long date formatting logic, here is what I would do:

    String spanishDatePattern = "{0,number,00} {1} {2,number,####}";
    String spanishLongDateMonthNameNovember = "de noviembre de";
    
    Object[] arguments = { new Integer(date.getDate()),
                           spanishLongDateMonthNameNovember,
                           new Integer(date.getYear()) };
    String formattedDate = MessageFormat.format(spanishDatePattern,
                    arguments);
    

    In this case you will need 13 messages per language (12 month ~names and 1 pattern). Not that much, I believe.

    Of course this was just an example, in reality you would probably need to also add logic to resolve month names (having keys with name ending with month number, i.e. longDateFormatMonthName.0=January?).

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

Sidebar

Related Questions

We would like to be able to reformat C++ blocks/functions of code directly from
I would like to be able to convert simple one digit time strings into
I currently have a custom log manager that internally uses java.util.Formatter . The main
I would like to retrieve the browser history from the com.android.browser and save it
I need to extract some specific functionality from a large legacy Java codebase, in
I realize a lot of questions like 'what cms should I use / what
Related question How to configure IntelliJ IDEA and/or Maven to automatically add directories with
Currently, running prove with TAP::Formatter::JUnit supports an environment variable PERL_TEST_HARNESS_DUMP_TAP that sets a path
I'm sure there must be a simple solution to this... I have a SQLite
I am using Smarty on a project and I'm finding myself doing far too

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.