- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2025 09:03 AM
Hi,
Below is the transform script i have tried into OnBefore, but i am getting the error "org.mozilla.javascript.EvaluatorException: Cannot convert NaN to java.lang.Long" .
Pls advise the script to convert the string format to date format. Thanks.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2025 12:19 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2025 10:24 AM
@Deepa12 Please update the script as follows and see if it works for you.
if(source.u_lastlogontimestamp){
var gdt = new GlideDateTime();
var mstime = parseInt(source.u_lastlogontimestamp);
gdt.setNumericValue((mstime - 116444736000000000) / 10000);
target.u_active_directory_last_login_date = gdt.getValue();
}
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2025 10:46 AM
Thanks for reply, Still i am getting the error message.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2025 06:31 PM
@Deepa12 What does the number
116444736000000000
represent here in the calculation here.
The issue here is number doesn't represent a valid value in terms of date in Epoch date and time which is usually 13 digit long
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2025 11:34 AM
The above onbefore script has worked after removed field map of lastlogontimestamp.