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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:13:16+00:00 2026-06-03T05:13:16+00:00

I have a date object: var thedate = new Date(2012-05-02T11:00:00.000+0000); When I do getMonth()

  • 0

I have a date object:

var thedate = new Date("2012-05-02T11:00:00.000+0000");

When I do getMonth() I get 4, but when I do getDay() I get 3? I want to make it so that when I call getDay, I get what’s reflected in the original string (2). I could just subtract 1 from getDay(), but I’m not sure if that’s the right way to do it, and whether it applies to all dates.

  • 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-03T05:13:18+00:00Added an answer on June 3, 2026 at 5:13 am

    According to MDN, getMonth will return a number in the range 0-11 (so 0 is for January), and getDay will return the day of the week in the range 0-6 (so 0 is for Sunday). If you want to get the day in month, you should use getDate, which will return a number in the range 1-31.

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

Sidebar

Related Questions

I have date in sting object in following format. dd/mm/yyyy I want to change
Let's say I have an object: public class CustomObj { DateTime Date { get;
I have a date in the format 16-2-2012 . var k = getTomorrow('16-02-2012',1); var
I have a Javascript Date object equal to 00:30 and when doing: date.setMinutes(date.getMinutes() +
I have a current Date object that needs to be incremented by one day
I have been trying to add to the Watch window a Java Date object
How to sort list of date object ? For example I have unsorted list
I have an XML object being returned, and inside is a date and time
I have about eight prototype functions for the Date object. I would like to
I am trying to get my object's method to work, but am missing something

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.