LastDayoftheMonth()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2014 07:14 AM
I'm trying to figure out if any one had done to get the last day of the month. I would like to pass the Month and the year and it would return me the last date. Somethign similar to the javascript function as shown below.
var date = new Date();
var firstDay = new Date(date.getFullYear(), date.getMonth(), 1);
var lastDay = new Date(date.getFullYear(), date.getMonth() + 1, 0);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2014 07:44 AM
Hi Shahbaab,
U can use this to get the last day of month:
var gdt = new GlideDateTime();
gs.print(gdt.getDaysInMonth());
Check this out :
http://wiki.servicenow.com/index.php?title=GlideDateTime#getDaysInMonth.28.29
also see this :
http://wiki.servicenow.com/index.php?title=GlideSystem_Date_and_Time_Functions#endOfThisMonth.28.29