Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2025 12:33 PM
I am trying to update the date time field with date value and it is not working. Tried the following:
var date = current.temp_date;
var gdt = new GlideDateTime(date);
if (gdt.getValue() != ''){
gdt.addHours(11);
gdt.addMinutes(59);
gs.info("Date Time " + gdt.getDisplayValue());
current.due_date = gdt.getDisplayValue();
//current.due_date = gdt.getValue();
}
Tried this but could not get it to work, Tried with and without adding hours and minutes.
Solved! Go to Solution.
1 ACCEPTED SOLUTION
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2025 12:43 PM
Hi @samadam ,
try this
var date = current.getValue('temp_date');
var gdt = new GlideDateTime(date + ' 11:59:00');
if (gdt.getValue() != '') {
// gdt.addHours(11);
// gdt.addMinutes(59);
gs.info("Date Time " + gdt.getDisplayValue());
current.due_date = gdt.getDisplayValue();
}
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2025 12:43 PM
Hi @samadam ,
try this
var date = current.getValue('temp_date');
var gdt = new GlideDateTime(date + ' 11:59:00');
if (gdt.getValue() != '') {
// gdt.addHours(11);
// gdt.addMinutes(59);
gs.info("Date Time " + gdt.getDisplayValue());
current.due_date = gdt.getDisplayValue();
}
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2025 01:02 PM
Thank you, that worked.