- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2019 10:49 AM
In ServiceCatalog Date variable I am getting current Year (2019 )using the below default value
javascript: var gdt = new GlideDateTime(gs.nowDateTime());gdt.getYear();
But I need to get 2020 as from ( ex May) a month fiscal year starts .
How to achieve that ?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2019 12:04 PM
Try this code.
var gdt = new GlideDateTime(gs.nowDateTime());
if(gdt.getMonth()+1 <=3)
return gdt.getYear();
else
return gdt.getYear()+1;
Mark the comment as a correct answer and also helpful once worked.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2019 12:04 PM
Try this code.
var gdt = new GlideDateTime(gs.nowDateTime());
if(gdt.getMonth()+1 <=3)
return gdt.getYear();
else
return gdt.getYear()+1;
Mark the comment as a correct answer and also helpful once worked.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2019 01:42 PM
working fine but giving 2020.0
How to get rid of .0 ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2023 07:04 AM
@ragz - did you figure this out? Can you drop the javascript: value if so? Thanks