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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T22:59:33+00:00 2026-06-08T22:59:33+00:00

I cant get the month and day from the date object like this :

  • 0

I cant get the month and day from the date object like this : “2009/12/30”

The error which gives in the console is: TypeError: created_at.getMonth is not a function

    function search(){
    var value = $('#box').val();
    var array=[];
    var dateArray = [];
    var datesString;
    if (value!==""){$.getJSON("http://search.twitter.com/search.json?callback=?&q=value&rpp=5",
      function(data){

   $.each(data.results, function(i, item){
       var user=item.from_user;
      var created_at=item.created_at;
      var n=created_at.toString();
       var month=n.getMonth();
      var day = n.getDate();
      var year = n.getFullYear();
      var created=month+day+year;
      array.push({date:created,username:user});
     });

Anyone knows what the problem is?
thanks!

  • 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-08T22:59:35+00:00Added an answer on June 8, 2026 at 10:59 pm

    JSON doesn’t support Date values directly, so Twitter is serializing each created_at value as a String that you’ll first have to parse:

    var user = item.from_user;
    var created_at = new Date(item.created_at);
    

    Then, you can use Date methods to get information from it:

    var month = created_at.getMonth();
    var day = created_at.getDate();
    var year = created_at.getFullYear();
    

    Also, if created is intended to be a Date at midnight, try this instead:

    var created = new Date(year, month, day);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Cant get this script to work with my menu really have tried everything any
I cant get jquery's date picker to work on my page. I have a
Probably I cant get more dumb, but seriously this is the first time I
I'm probably doing something realy stupid but I cant get this to work: var
I'm developing an application and I need to get the current date from a
I'm trying to change this timestamp 2010-08-02 00:28:20 to month/day/year - 08/02/10 ..in the
I cant seem to get this working, i need to display the Total Order
I can't figure this out at all. I did: int num = ((month-1)*30+day)%134; //a,b,c
I have a list of HashMap in my Action class, something like {month=05, day=20,
I cant get a PHP file to send correct headers at my WAMP server.

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.