- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-30-2020 05:11 AM
Hi All,
When I am trying to import value for Date/Time field, and it the hours is 12, it is automatically converting it to 00. But it is working properly when it is 13Hr or even 23Hr.
For example, If I import 2020-03-05 12:50:40 in system it comes as 2020-03-05 00:50:40.
But, If I import 2020-03-05 13:50:40 in system it comes as 2020-03-05 13:50:40 properly.
Also there is no AM or PM mentioned. What can be the issues?
This is happening for all Date/Time fields present in my table.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-04-2020 09:56 PM
Hi All,
Issue was solve just by changing the Date/Time Format in Field mapping from yyyy-mm-dd hh:mm:ss to yyyy-mm-dd HH:mm:ss.
Just changed hh to HH format.
Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-30-2020 07:45 AM
Hi,
Can you share how it looks in import set table since you are doing some split etc?
Regards
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
ā06-30-2020 10:56 PM
They are sending date as 2020-04-03 12:25:35.344.
So we are just splitting to remove that milli-second part. And as the field in Tmport set table is string, it is same as 2020-04-03 12:25:35.344.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-30-2020 11:19 PM
Hi Anubhav,
did you check by adding log whether you are getting the correct value after doing the split etc
Did you check for which values it is behaving in this way
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
ā06-30-2020 11:38 PM
Can you use onBefore transform script instead of field map and use this script
// your string manipulation here
// then do this
var time = new GlideDateTime(datTime);
target.<fieldName> = time;
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
ā07-01-2020 12:36 AM
Hi,
this worked for me well in onBefore transform script
target.setDisplayValue('u_sample_date_time', source.u_time_string);
Incoming value: 2020-04-03 12:25:35
Target Value: Set correctly
So you also try to handle using onBefore transform script; Also ensure the source field is of type string and not date/time
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