- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2020 04:39 AM
Hi All,
As part of integration, we will get some data monthly once into ServiceNow table.
'Usage date' is one of the field on the table [ date type field].
Our client wants to have this populated as last day of the last month.
For eg., if data arrives on June 25th, 2020,
Usage date should store it as May 31st, 2020.
could anyone help me with this requirement.
Regards,
Venkata
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2020 05:10 AM
Try this.
var month = gs.endOfLastMonth();
var monthd = new GlideDateTime(month);
monthd.addDays(-1);
gs.info(monthd);
output
Please mark this correct & helpful if it answered your question.
Thanks & Regards,
Sharjeel
Muhammad

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2020 05:10 AM