aslamdoctor
aslamdoctor

Reputation: 3935

How to get the Last Day of the Current month using javascript?

I would like to know how can we fetch the Last day of the current month using javascript. E.g. last day of January is Tuesday

Upvotes: 0

Views: 7344

Answers (1)

user578895
user578895

Reputation:

var       today = new Date()
  , lastOfMonth = new Date( today.getFullYear(), today.getMonth()+1, 0 )
  ,   dayOfWeek = lastOfMonth.getDay();

dayOfWeek now = 0 for sunday... 6 for saturday

Upvotes: 1

Related Questions