我有UTC格式的日期和時(shí)間,例如:我的日歷生成代碼。我正在使用fullcalendar.io。//for loop startsessionCalendar.push( { title: `${course["course_name"]}`, start: start_date_time.split(" ").join("T"), end: end_date_time.split(" ").join("T"), },)//for loops end如您所見,我T在日期和時(shí)間中間添加了UTC格式。var calendarEl = document.getElementById('calendar');var calendar = new FullCalendar.Calendar(calendarEl, { plugins: [ 'dayGrid', 'timeGrid', 'list', 'interaction' ], header: { left: 'prev,next today', center: 'title', right: 'dayGridMonth,timeGridWeek,timeGridDay,listWeek' }, defaultDate: '2019-04-12', navLinks: true, editable: false, eventLimit: true, events: sessionCalendar, timeZone: timeZone // var timeZone = "Asia/Kolkata"});calendar.render();在上面的代碼中,我設(shè)置了動(dòng)態(tài)的timeZone值。不過,我看到的日期和時(shí)間start_date_time與屏幕截圖中的UTC格式相同。如何將UTC日期和時(shí)間轉(zhuǎn)換為用戶指定的時(shí)區(qū)?根據(jù)評(píng)論。我在末尾加了“ Z”
如何在fullCalendar.io中將UTC日期轉(zhuǎn)換為用戶時(shí)區(qū)
寶慕林4294392
2021-04-29 17:28:17