首页 > 学院 > 开发设计 > 正文

toUTCString 方法

2019-11-18 11:07:59
字体:
来源:转载
供稿:网友

 

返回一个已被转换为字符串的,用全球标准时间 (UTC)表示的日期。

dateObj.toUTCString()

必选项 dateObj 参数为任意 Date 对象。

说明

toUTCString 方法返回一个 String 对象,此对象中包含了使用 UTC 惯例以一种方便易读的形式进行格式化的日期。

示例

下面这个例子说明了 toUTCString 方法的用法。

function toUTCStrDemo(){   var d, s;                   // 声明变量。   d = new Date();             // 创建 Date 对象。   s = "Current setting is ";   s += d.toUTCString();       // 转换为 UTC 字符串。   return(s);                  // 返回 UTC 字符串。}

要求

版本 3

请参阅

Date 对象的方法 toGMTString 方法

应用于: Date 对象



上一篇:Array 对象

下一篇:unescape 方法

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表