Converting Date to Date/time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-06-2013 09:44 PM
This is probably a simple one but I'm looking to convert a date to date+time field. I'm starting a service catalog entry for an onboarding request and the start date field is a date type. I want the due date to be the start date, but when because the system is looking for date/time the field does not populate. So I'm guessing I need to convert the date to match the format the system is looking for.
Does anyone have a quick script for this or am I missing a date/time function that's built into the system?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2016 02:40 PM
Date & time usually is pretty messy. But I played around and noticed even this worked in a script background:
Field "u_only_date" is the date field and field "u_both_date_time" is a date/Time field.
var gr = new GlideRecord('change_request');
gr.get('625a7a100f3312004cf365ba32050e1a');
gr.u_both_date_time = gr.u_only_date;
gr.update();