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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:37:55+00:00 2026-06-15T15:37:55+00:00

I receive the below JSON and i am able to parse through the Description

  • 0

I receive the below JSON and i am able to parse through the Description and date. I have been trying to parse through the time but everything that i try keeps giving me bad output.

The time object is supposed to say 5:30 but i do not know if i am able to parse through that format. I thought it was public String format3339 (boolean allDay)
I have posted the JSON Input, my JSON parsing, and the output.

Input

{"object":[{"description":"blah blah blah","date":"2012-12-11","time":"2000-01-01T05:30:00Z"}]}

Mainly i am worried about "time":"2000-01-01T05:30:00Z"

Parsing

JSONArray arr = null;
list = new ArrayList<HashMap<String, String>>();
}
for (int i = 0; i < arr.length(); i++) {
    JSONObject d = arr.getJSONObject(i);
    Time time = new Time();
    String etime = d.getString(TIME_TAG);
    String description = d.getString(DESCRIPTION_TAG);
    String date = d.getString(DATE_TAG);
            //************************************************************************
            //********I suspect that i might be converting the time object incorrectly but whatever 
            //********i put here either does not work or gives me bad output. 
    Boolean mtime = time.parse3339(etime);
    if (mtime == true) {
        etime = time.toString();
    }
            //************************************************************************
    HashMap<String, String> map = new HashMap<String, String>();
    map.put(DATE_TAG, date);
    map.put(DESCRIPTION_TAG, description);
    map.put(TIME_TAG, etime);

    list.add(map);

OutPut- I do not understand this output I thought that the input was 3339 format but the output is difficult to work with. I guess i could make a parser to parse out the 530 from the string given but i thought my output would be YYYYMMDDTHHMMSS format from the toString() operation.

20000101T053000UTC(0,0,0,-1,946704600)

EDIT::Here is what i hacked together to get what i want with little effort. It works for now.

JSONArray arr = null;
list = new ArrayList<HashMap<String, String>>();
}
for (int i = 0; i < arr.length(); i++) {
    JSONObject d = arr.getJSONObject(i);
    String etime = d.getString(TIME_TAG);
    String description = d.getString(DESCRIPTION_TAG);
    String date = d.getString(DATE_TAG);

        if (eTime.charAt(11) == '0')
    eTime = eTime.substring(12, 16);
    else
    eTime = eTime.substring(11, 16);

            HashMap<String, String> map = new HashMap<String, String>();
    map.put(DATE_TAG, date);
    map.put(DESCRIPTION_TAG, description);
    map.put(TIME_TAG, etime);

    list.add(map);
  • 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-15T15:37:56+00:00Added an answer on June 15, 2026 at 3:37 pm

    The best way to solve most Json format problems is to go vise versa: Create your Time, convert to Json Object and investigate String representation. I think you will find your issue quickly.

    About your problem: DateTime format you posted is ISO 8601. JSON does not specify this format for dates/times.

    You can try to use Joda Time to get proper Date type that Json can parse.

    Or ISO time format

    Or other pretty good way to use GSON library.

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

Sidebar

Related Questions

I receive a date in the format below from a json file. Im not
I have problems with receiving json through ajax, the error is below. According to
I have a Json response that I receive from an API call. It has
I receive json from a webservice into a NSMutableData. That gets converted into a
I'm trying to loop the key/value pairs I receive below in my query and
I have a backend that returns some JSON data that is used by my
I have been stuck on this problem for a very long time. I have
I have a problem deserializing a JSON string using Jackson (but I have no
I believe that i have followed the documentation on SendGrid's site but so far
I have been having some issues retrieving JSON data from a WCF service application

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.