In order to do this, you have to create an instance of the built-in Date object and call its getMonth() and getDate() method.
var termUpdater = new Date();
updateDate = termUpdater.getDate();
updateMonth = termUpdater.getMonth();
getDate()
returns 1-31 based on the current date.
getMonth()
returns 0-11 based on the current month.
By default, the Date object will refer to the current date and time. But you can also pass an optional argument for it to force to refer to some other date which is unnecessary in your case but still here's how it's done:
var dateObj = ("January 1, 1983 01:15:00");
Now, you can say:
if (updateMonth == 0 || updateMonth == 1){ //0 means Jan
term = winter;
}
else if ((updateDate >= 15&& updateMonth==2) || (updateMonth <= 7 && updateMonth > 2 )){
term = spring;
}
else if ( updateMonth >= 8){
term = fall;
}