- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 07:12 AM
Hi,
I'm Parsing an email & currently, I'm receiving the date as format 09/13/2023 & I want to change it to 2023-09-13 this format while adding one day in it. In short, if the date we are receiving is 09/13/2023 then in xyz field (string type field) ii should populated as 2023-09-13.
Can someone please help me out here?
Thanks in advance!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2023 08:19 AM
@Chirag Jain3 Here is the updated script.
var dateToCovert = "09/13/2023";
var dateArray = dateToCovert.split('/');
var convertedDate = dateArray[2]+'-'+dateArray[0]+'-'+dateArray[1];
gs.info(convertedDate);
var someDate = new GlideDate();
someDate.getByFormat('yyyy-MM-dd');
someDate.setValue(convertedDate);
someDate.addDays(1);//Add one day here
gs.info(someDate.getValue());
Don't forget to upvote and mark this answer correct if it manages to address your issue.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2023 07:29 AM
Here is the script.
var dateToCovert = "09/13/2023";
var dateArray = dateToCovert.split('/');
var convertedDate = dateArray[2]+'-'+dateArray[0]+'-'dateArray[1];
gs.info(convertedDate);
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2023 06:35 AM
Hi Sandeep,
I want to add one day to it in the same format, let's say the date that i have received is 09/30/2023, so i want to populate the date by adding one day to it i.e. 2023-10-01

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2023 08:19 AM
@Chirag Jain3 Here is the updated script.
var dateToCovert = "09/13/2023";
var dateArray = dateToCovert.split('/');
var convertedDate = dateArray[2]+'-'+dateArray[0]+'-'+dateArray[1];
gs.info(convertedDate);
var someDate = new GlideDate();
someDate.getByFormat('yyyy-MM-dd');
someDate.setValue(convertedDate);
someDate.addDays(1);//Add one day here
gs.info(someDate.getValue());
Don't forget to upvote and mark this answer correct if it manages to address your issue.