- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2019 01:37 PM
In one of my forms/workflows, the user picks a date which is put in the short description as Month/Year. The problem: When the user picks 10/1/2019, the short description puts 9/2019 but when the user picks a different date like 10/15/2019 or 10/2/2019 the short description puts 10/2019.
var event = new GlideDateTime(current.variable_pool.usabyod_date);
current.short_description="Receipt for " + current.variable_pool.usabyod_name.name +" "+ event.getMonth() +"/"+ event.getYear();
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2019 07:32 AM
Hi,
can you try with getMonthUTC()
var event = new GlideDateTime(current.variable_pool.usabyod_date);
current.short_description="Receipt for " + current.variable_pool.usabyod_name.name +" "+ event.getMonthUTC() +"/"+ event.getYear();
current.description="Receipt for " + current.variable_pool.usabyod_name.name +" "+ event.getMonthUTC() +"/"+event.getYear();
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2019 01:46 PM
Can you try
getMonthLocalTime()
Please mark my response as correct and helpful if it helped solved your question.
-Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2019 07:02 AM
Still getting a 9 instead of the 10.
var event = new GlideDateTime(current.variable_pool.usabyod_date);
current.short_description="Receipt for " + current.variable_pool.usabyod_name.name +" "+ event.getMonthLocalTime() +"/"+ event.getYear();
current.description="Receipt for " + current.variable_pool.usabyod_name.name +" "+ event.getMonthLocalTime() +"/"+event.getYear();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2019 07:15 AM
See if changing it to getMonthUTC() will help
Please mark my response as correct and helpful if it helped solved your question.
-Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2019 07:32 AM
Hi,
can you try with getMonthUTC()
var event = new GlideDateTime(current.variable_pool.usabyod_date);
current.short_description="Receipt for " + current.variable_pool.usabyod_name.name +" "+ event.getMonthUTC() +"/"+ event.getYear();
current.description="Receipt for " + current.variable_pool.usabyod_name.name +" "+ event.getMonthUTC() +"/"+event.getYear();
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader