- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-30-2020 04:00 AM
Hi Team,
I have a requirement to display date into DD-MMM-YYYY format in email notification from virtual agent.
By default it is giving YYYY-MM-DD.
Solved! Go to Solution.
- Labels:
-
Virtual Agent
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-30-2020 09:51 AM
Hi Kamer,
I tried this code and working fine for as per your requirement what i understood.Please find the below code snippet
var startDate = vaInputs.start_date; // start_date is input control name
var df = 'yyyy-MM-dd';
var gdt = new GlideDateTime(startDate);
gdt.setDisplayValue(startDate.df);
var localedt =gdt.getLocalDate();
var getStart= localedt.getByFormat('dd-MMM-yyyy');
output:
input from user:2020-03-30
output:30-Mar-2020
Hope this is helpful and please mark if you find the appropriate solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-30-2020 05:04 AM
Hi Kamer
Here is the script, Please try this in yours
var gd = new GlideDate();
//lets say the date is
gd.setValue('2020-01-01');
return{
s.setStringParameter('u_actual_date', gd.getByFormat("MM/dd/yyyy")); //value of actual date
}
Please mark my answer correct and helpful, If this helps you in any waty thanks in advance
Saurabh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-30-2020 09:51 AM
Hi Kamer,
I tried this code and working fine for as per your requirement what i understood.Please find the below code snippet
var startDate = vaInputs.start_date; // start_date is input control name
var df = 'yyyy-MM-dd';
var gdt = new GlideDateTime(startDate);
gdt.setDisplayValue(startDate.df);
var localedt =gdt.getLocalDate();
var getStart= localedt.getByFormat('dd-MMM-yyyy');
output:
input from user:2020-03-30
output:30-Mar-2020
Hope this is helpful and please mark if you find the appropriate solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-30-2020 09:11 PM
Hi Imam ,
Thank You.Its working now