通过new Date()获取的默认时区就是GMT,ArkTS是基于ts的,对于时间处理是一样的,参考:let nowDate = new Date(); console.log('nowDate----',nowDate) console.log('year ----',nowDate.getFullYear()) console.log('month ----',nowDate.getMonth()+1) console.log('date ----',nowDate.getDate()) console.log('hours ----',nowDate.getHours()) console.log('minute ----',nowDate.getMinutes()) console.log('second ----',nowDate.getSeconds())
通过new Date()获取的默认时区就是GMT,ArkTS是基于ts的,对于时间处理是一样的,参考: