- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2023 09:33 AM
Hi All,
having a requirement that need to convert the data format from dd-MM-yyyy to dd/MM/yyyy on the flow designer
by the below script in the flow designer by flow variables
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2023 09:43 AM
var dt = gs.nowDateTime();
var parts = dt.split('-');
var day = parts[0];
var month = parts[1];
var year = parts[2];
var formattedDate = day + '/' + month + '/' + year;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2023 10:38 AM
Hi @jMarshal
The script you suggested is working
var gd =new GlideDate();
var dt = gs.nowDateTime();
dt = dt.toString().split(" ")[0];
var parts = dt.split('-');
var day = parts[0];
var month = gd.getMonth();
month = month.toString();
month = "0" + month;
month = month.slice(-2);
var year = gd.getYear();
var formattedDate = day + '/' + month + '/' + year;
return formattedDate;
in the above script i changed for year then it completely retrieving the value as required
20/06/2023.
Thank You @jMarshal .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2023 09:43 AM
var dt = gs.nowDateTime();
var parts = dt.split('-');
var day = parts[0];
var month = parts[1];
var year = parts[2];
var formattedDate = day + '/' + month + '/' + year;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2023 03:53 PM
Hi @jMarshal
The date format is coming up but its in 16/Jun/23
need to get the value like 16/06/2023..
any suggestions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2023 08:18 AM
yup try this instead --- replacing the month from the parsed values with the numerical value:
var parts = dt.split('-');
var day = parts[0];
var month = dt.getMonth() + 1;
var year = parts[2];
var formattedDate = day + '/' + month + '/' + year;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2023 12:00 PM
Hi @jMarshal
tried as you suggested but not able to retrieve the value result as below
need to get the date value in the format 19/06/2023.
tried another way but its not working.