using .setUTCHours()
it would be possible to actually set dates in UTC-time, which would allow you to use UTC-times throughout the system.(使用.setUTCHours()
,可以在UTC时间中实际设置日期,这将使您可以在整个系统中使用UTC时间。)
You cannot set it using UTC in the constructor though, unless you specify a date-string.
(
但是,除非指定日期字符串,否则不能在构造函数中使用UTC进行设置。
)
Using new Date(Date.UTC(year, month, day, hour, minute, second))
you can create a Date-object from a specific UTC time.(使用new Date(Date.UTC(year, month, day, hour, minute, second))
,可以从特定的UTC时间创建日期对象。) 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…