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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T08:08:46+00:00 2026-05-29T08:08:46+00:00

I’m developing a function that extracts a date from a String and convert it

  • 0

I’m developing a function that extracts a date from a String and convert it to a Date.
The date have the following format:

dd-mmm-yyyy

where mmm is the month 3-digit name all lowercased.

The piece of code is the following:

if(queryLine.contains("Expiration Date:")){
String expString = queryLine.replace("Expiration Date:", "").trim();
DateFormat df = new SimpleDateFormat("dd-MMM-yyyy");
try {
    log.info("Exp: " + queryLine.replace("Expiration Date:", "").trim());
    expDate = df.parse(expString);
} catch (ParseException e) {                         
    e.printStackTrace();
}                   

If i try that code on a computer jvm it works fine and it converts the date without problem, but if i try to run it on android i have the following error:

java.text.ParseException: Unparseable date: "14-sep-2020"
     at org.whoislibrary.servers.WhoisCom.parseResponse(WhoisCom.java:39)
     at java.text.DateFormat.parse(DateFormat.java:626)
     at org.whoislibrary.WhoisAbstract.executeQuery(WhoisAbstract.java:47)
     at org.whoislibrary.WhoisCommand.executeQuery(WhoisCommand.java:72)
     at org.HttpTest.HttpTestActivity.onCreate(HttpTestActivity.java:35)
     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1586)
     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1638)
     at android.app.ActivityThread.access$1500(ActivityThread.java:117)
     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:928)
     at android.os.Handler.dispatchMessage(Handler.java:99)
     at android.os.Looper.loop(Looper.java:123)
     at android.app.ActivityThread.main(ActivityThread.java:3647)
     at java.lang.reflect.Method.invokeNative(Native Method)
     at java.lang.reflect.Method.invoke(Method.java:507)
     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
     at dalvik.system.NativeStart.main(Native Method)

Any idea?

  • 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-29T08:08:48+00:00Added an answer on May 29, 2026 at 8:08 am

    Not 100% sure (I will check in a moment) but I think the problem is that for MMM your month must be in proper locale too. So Sep on your PC (presumably locale set to EN) would need to be expressed in Italian if you use Italian locale on Android.
    Could you try it?

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
Does anyone know how can I replace this 2 symbol below from the string
I need a function that will clean a strings' special characters. I do NOT
I have a bunch of posts stored in text files formatted in yaml/textile (from
link Im having trouble converting the html entites into html characters, (&# 8217;) i

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.