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

  • Home
  • SEARCH
  • 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 6086403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:45:03+00:00 2026-05-23T11:45:03+00:00

My app is calling up a Twitter feed and a blog feed, both contain

  • 0

My app is calling up a Twitter feed and a blog feed, both contain a post date of course. When my phone is set to English locale it works, when I switch to Dutch or German it fails. The code in question does not even call upon the locale, and the input values are also independent of the locale.

The offending code:

tweets is a JSONObject containing the complete Twitter feed.

final SimpleDateFormat formatter = 
    new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
final SimpleDateFormat parser = 
    new SimpleDateFormat("EEE MMM dd HH:mm:ss Z yyyy");

for (int i = 0; i < tweets.length(); i++) {
    final JSONObject tweet = tweets.getJSONObject(i);

    // The following line is where the failure occurs:
    values.put(KEY_TWEET_DATE, formatter.format(parser.parse(tweet
        .getString("created_at"))));
}

This works as long as my locale is English.

As soon as I switch to German or Dutch (my app contains translations for those two languages, I haven’t tried any other so far) I get an error like this:

WARN/System.err(28273): java.text.ParseException: Unparseable date: Wed Jun 29 10:55:41 +0000 2011
WARN/System.err(28273):     at java.text.DateFormat.parse(DateFormat.java:645)
WARN/System.err(28273):     at squirrel.DeaddropDroid.DeaddropDB.updateTwitter(DeaddropDB.java:1453)

The “unparseable date” is the correct date, in the expected format. My format string is designed to parse that exact date. And as said, when I switch my phone to English locale, it works just fine. It’s the same code: the error occurs even when I switch the locale while the app is running, and disappears when I switch back the locale.

  • 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-23T11:45:04+00:00Added an answer on May 23, 2026 at 11:45 am

    If you need to parse in a particular locale, pass that into the SimpleDateFormat constructor:

    final SimpleDateFormat parser =
        new SimpleDateFormat("EEE MMM dd HH:mm:ss Z yyyy", Locale.US);
    

    That means it will always use the US locale for day and month names etc.

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

Sidebar

Related Questions

I am trying to integrate with a vendors app by calling it with command
I need a console app which will calling webmethod. It must be asynchronous and
I'm writing an app that is calling a server to get data to show
here is the problem : there is classic asp app which is calling lame.exe
I'm calling a web service from a console app - all in C# on
Copied: bin runtimes airApp-app.xml airApp.swf Calling: G:\adl\bin\adl.exe -nodebug G:\adl\airApp-app.xml Nothing on the screen, nothing
i deployed my App to my iPhone and get Unknown error calling sqlite3_step (8:
It seems that calling a P-Invoke while the App is not completed loaded make
I am making an app in which i need to implement calling emergency medical
Scenario: WCF client app, calling a web-service (JAVA) operation, wich requires a complex object

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.