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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:20:27+00:00 2026-05-14T04:20:27+00:00

my input String is : 2010-03-24T17:28:50.000Z output pattern is like: DateFormat formatter1 = new

  • 0

my input String is : 2010-03-24T17:28:50.000Z

output pattern is like:

DateFormat formatter1 = new SimpleDateFormat("EEE. MMM. d. yyyy");

i convert this like this:

formatter1.format(new Date("2010-03-24T17:28:50.000Z"));//illegalArgumentException here the string "2010-03-24T17:28:50.000Z"

ouput should be like this: Thu. Mar. 24. 2010 idea

but i get a illegalArgumentException. Dont know why? any idea??

stacktrace message is:

04-08 19:50:28.326: WARN/System.err(306): java.lang.IllegalArgumentException
04-08 19:50:28.345: WARN/System.err(306):     at java.util.Date.parse(Date.java:447)
04-08 19:50:28.355: WARN/System.err(306):     at java.util.Date.<init>(Date.java:157)
04-08 19:50:28.366: WARN/System.err(306):     at com.example.brown.Bru_Tube$SelectDataTask.doInBackground(Bru_Tube.java:222)
04-08 19:50:28.366: WARN/System.err(306):     at com.example.brown.Bru_Tube$SelectDataTask.doInBackground(Bru_Tube.java:1)
04-08 19:50:28.405: WARN/System.err(306):     at android.os.AsyncTask$2.call(AsyncTask.java:185)
04-08 19:50:28.415: WARN/System.err(306):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
04-08 19:50:28.415: WARN/System.err(306):     at java.util.concurrent.FutureTask.run(FutureTask.java:137)
04-08 19:50:28.446: WARN/System.err(306):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)
04-08 19:50:28.456: WARN/System.err(306):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)
04-08 19:50:28.466: WARN/System.err(306):     at java.lang.Thread.run(Thread.java:1096)
  • 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-14T04:20:28+00:00Added an answer on May 14, 2026 at 4:20 am

    The problem is in this part:

    new Date("2010-03-24T17:28:50.000Z")
    

    Apparently it doesn’t accept dates/times in that format.

    You shouldn’t be using that constructor anyway – create an appropriate formatter to parse that particular format, and then parse it with that.

    Alternatively, use Joda Time to start with, and avoid using DateFormat completely. I don’t know if you can use Joda Time from Android, mind you… and it’s fairly large.

    EDIT: To spell it out explicitly:

    String inputText = "2010-03-24T17:28:50.000Z";
    // "Z" appears not to be supported for some reason.
    DateFormat inputFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
    inputFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
    DateFormat outputFormat = new SimpleDateFormat("EEE. MMM. d. yyyy");
    Date parsed = inputFormat.parse(inputText);
    String outputText = outputFormat.format(parsed);
    
    // Output is Wed. Mar. 24 2010 on my box
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I have the following date as String format. Input 2010-04-20 05:34:58.0 Output I
string input = @12.2.2010|7; string pattern = @|; foreach (string result in Regex.Split(input, pattern))
My input string is '16-MAR-2010 03:37:04' and i want to store it as datetime.
My input is String formated as the following: 3/4/2010 10:40:01 AM 3/4/2010 10:38:31 AM
Sample input string: char *str = 12345.567675; And the desired output if I need
If I have a string like : 10.120.230.172 DOM1/HKJ - 2010-11-04 08:05:30 - -
if i try to cast string date to datetime like select cast('12/01/2010' as datetime)
Have a text input box. Would like the user to enter a string in
I am trying to convert a string of this format: MM/dd/yyyy HH:mm The input
Given that an input String may be specified as follows: read(xpath(‘...’)) or xpath(‘...’) or

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.