JS和jdk8获取utc+0时间的方法

js

alert(new Date( new Date().getUTCFullYear(), new Date().getUTCMonth(), new Date().getUTCDate(), new Date().getUTCHours(), new Date().getUTCMinutes(), new Date().getUTCSeconds() ));

java

OffsetDateTime.now(ZoneOffset.UTC).toLocalTime();

猜你喜欢

转载自blog.csdn.net/qq_37928038/article/details/130263939