- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2025 10:30 PM
Hi All,
In my User profile changed the date format to dd-MM-yyyy.
am loading the data thr transform, in source table for the start date field i have taken as string.
in Source table date is 19-03-2025.
Am just mapping to the target field, but in target field it showing as "14-09-0024".
If I try with new GlideDateTime() it is returning as "2025-03-19"
Don't know how it has changed.
but I want date should be same as Source table date "19-03-2025"
Can you please help me.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2025 10:57 PM
Hello @sainath3 ,
You can use below code to ensure the format.
var new gdt = new GlideDate();
gdt.getByFormat("dd-MM-yyyy");
If this solution helped resolve your issue, please consider marking it as helpful or correct.
This will assist others in finding the solution faster and close the thread.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2025 11:29 PM
see the date will be set properly in target field
But the date it will display is based on your date format in sys_user or in preferences
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2025 10:40 PM
it's nothing to do with your user profile date format
the field map for that date, you can the date format there and the date format should be dd-MM-yyyy as the date will come in that format in source table
Click on that suggestion icon and select the date format
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2025 11:07 PM
Hi Ankur,
I have tried to change the date fromat in field script to dd-MM-yyyy.
Still showing wrong format
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2025 11:29 PM
see the date will be set properly in target field
But the date it will display is based on your date format in sys_user or in preferences
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2025 10:57 PM
Hello @sainath3 ,
You can use below code to ensure the format.
var new gdt = new GlideDate();
gdt.getByFormat("dd-MM-yyyy");
If this solution helped resolve your issue, please consider marking it as helpful or correct.
This will assist others in finding the solution faster and close the thread.