无涯教程-toUTCString()函数

35 阅读1分钟

toUTCString()方法使用根据世界时返回 1970 年 1 月 1 日 到指定日期的毫秒数。

toUTCString() - 语法

Date.toUTCString () 

toUTCString() - 返回值

使用通用时间约定将转换后的日期返回为字符串。

toUTCString() - 示例

var dateobject=new Date(1993, 6, 28, 14, 39, 7); 
console.log( dateobject.toUTCString() );           

运行上面代码输出

Wed, 28 Jul 1993 09:09:07 GMT           

参考链接

www.learnfk.com/es6/es6-tou…