我无法从这样的日期对象中获取月份和日期:“2009/12/30”
控制台中给出的错误是: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});
});
任何人都知道问题是什么?谢谢!