Skip to content Skip to sidebar Skip to footer

Get Last 6 Months From In Jquery

How can I get the date range in jquery from current date, I have done following in java, need to replicate it in jquery Datetime sixMonthsFromNow = Datetime.now().addMonths(-6); so

Solution 1:

Javascript style for this piece of code (jQuery not required) :

var now = new Date();
var sixMonthsFromNow = new Date(now.setMonth(now.getMonth() - 6));
var sortByQueryString = 
    '&fq=lastmodified:[' + sixMonthsFromNow.toISOString() + '+TO+NOW]';

// &fq=lastmodified:[2013-11-27T08:57:10.089Z+TO+NOW]

Post a Comment for "Get Last 6 Months From In Jquery"