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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:42:02+00:00 2026-05-31T13:42:02+00:00

I get JSON from a server and parse it to an array. The date.month

  • 0

I get JSON from a server and parse it to an array.

The date.month propery is “03”, this is then added to a Date() object var date = new Date(year, month, day);

I convert the Date() object with date.toLocaleDateString()and the output in the iOS simulator is “April 5, 2012”.

How can this be?!?!?!

JavaScript and JSON source is here: http://developer.appcelerator.com/question/133958/month-of-date-object-is-3-but-tolocaledatestring-says-april

  • 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-31T13:42:03+00:00Added an answer on May 31, 2026 at 1:42 pm

    JavaScript Date objects track months as 0 through 11. January is 0, in other words, so April is 3. If your server-side code thinks months are 1 through 12, you just subtract one when making a JavaScript Date.

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

Sidebar

Related Questions

I take json object generate from a PHP script on my server and then
I am writing an application to get the json object from server. for example:
In my iPhone application I get json data from a remote server, parse it
I get the following NSDictionary when I parse a JSON response from my server:
I am trying to parse a JSON response from a server using javascript/jquery. This
I'm getting a json from server. I can parse only one JSON at time.
I made a script to get JSON data from a file on our server
I was using the SBJSON files from this JSON tutorial and then I tried
I am using JQuery's getJSON() to request JSON from my web server. Then, I
I'm trying to get my jQuery to work in this flow: Parse json using

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.