This function is only available when the source or target server is Service Now. It is used to convert a duration string with format <days> <hours>:<minutes>:<seconds> into a date/time value that can then be used to populate a Service Now Duration field.
In Service Now, a duration is stored as a date/time. The base date/time,1970-01-01 00:00:00, is offset by the number of days, hours, minutes and seconds in the duration.
The function will extract the number of days, hours, minutes and seconds of the duration from the formatted string and calculate the date/time value that will represent the duration in Service Now.
Examples:
SN_DURATION_STR_TO_DATETIME('12 10:45:30') = '1970-01-13 10:45:30'
SN_DURATION_STR_TO_DATETIME('10:45:00') = '1970-01-01 10:45:00'
SN_DURATION_STR_TO_DATETIME(NULL) = '1970-01-01 00:00:00'
Comments
0 comments
Please sign in to leave a comment.