Posted By

ashsa on 09/29/11


Tagged

date


Versions (?)

last day of a month


 / Published in: JavaScript
 

Using the day "zero" of the next month...

  1. // get last day of august as day zero of september
  2. var date = new Date(2011, 8, 0);
  3. // get last day of 2011
  4. var date = new Date(2012, 0, 0);
  5. // remember months are zero based!

Report this snippet  

You need to login to post a comment.