Claude D_
Tera Guru

I managed to create a BR that took separate Date fields and Time fields to combine into an acceptable format for my calendar. When I looked at the values, I did see that what Etienne posted is what is in the list view, but using an alert() to display the value via a Client Script for the cmn_schedule_span record displayed something else entirely.

alert() value displayed for start time = TZID=US/Central;2022-01-01 00:00:00

Since my timezone was set to US/Central, that's why mine returned the above value.

Below is an example BR excerpt just for the dates and times portion you are looking for help with. Just change the timezone ID to what is needed.

var startDate = current.start_date; //returned displayed value of Date field, no converting dates to UTC due to no time for Date field to use for conversion
var startTime = current.start_time.getDisplayValue(); //returned displayed value of Time field, removed date portion of value included without .getDisplayValue()
var endDate = current.end_date;
var endTime = current.end_time.getDisplayValue();

var start = 'TZID=US/Central;' + startDate + ' ' + startTime;
var end = 'TZID=US/Central;' + endDate + ' ' + endTime;

createSchedule(start,end);

function createSchedule(start,end){
var gr = new GlideRecord('cmn_schedule_span');
gr.initialize();
gr.start_date_time = start; //'TZID=US/Central;2022-01-01 00:00:00'
gr.end_date_time = end; //'TZID=US/Central;2022-01-01 08:00:00'
gr.insert();
}