返回一个已被转换为字符串的,用全球标准时间 (UTC)表示的日期。 必选项 dateObj 参数为任意 Date 对象。 toUTCString 方法返回一个 String 对象,此对象中包含了使用 UTC 惯例以一种方便易读的形式进行格式化的日期。 下面这个例子说明了 toUTCString 方法的用法。 版本 3 Date 对象的方法 | toGMTString 方法 应用于: Date 对象
dateObj.toUTCString()说明
示例
function toUTCStrDemo(){
var d, s; // 声明变量。
d = new Date(); // 创建 Date 对象。
s = "Current setting is ";
s += d.toUTCString(); // 转换为 UTC 字符串。
return(s); // 返回 UTC 字符串。
}要求
请参阅