How to set date/time field value to a specified time based on client's timezone ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2019 02:17 AM
I have a requirement that when requested by date field in change request is changed to a specific date, then start implementation start date and end date should also be populated as follows:
For Example:
Requested by date is changed to 12-Nov-2019.
Start Implementation start date should be populated as 12-Nov-2019 12:00:00 and start implementation end date as 12-Nov-2019 23:59:59.
I could able to set the date value but time values are setting as 07:00:00 and 18:59:59 respectively.
I am using a BR :
var dateTime = current.requested_by_date.split(" ");
var newdate = dateTime[0];
current.setValue('start_date', newdate +" 12:00:00" );
current.setValue('end_date', newdate +" 23:59:59" );
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2019 07:04 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2019 08:17 PM
you can use below code.
var gdt = new GlideDateTime(current.requested_by_date);
gs.print(gdt.getDisplayValueInternal());
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2019 08:20 PM
Hello,
Please refer below link,It would help you.
Please mark as Correct and helpful,If you find any help