码迷,mamicode.com
首页 > 其他好文 > 详细

【WXS数据类型】Date

时间:2018-11-05 23:42:27      阅读:231      评论:0      收藏:0      [点我收藏+]

标签:ToJson   ber   使用   一周   utc   对象   结构   value   名称   

属性:

名称 值类型 说明
[Date].construtor [String] 返回值为“Date”,表示类型的结构字符串

 

方法:

原型:[Date].toString()
说明:把 Date 对象转换为字符串

 

原型:[Date].toTimeString()
说明:把 Date 对象的时间部分转换为字符串

 

原型:[Date].toLocaleString()
说明:据本地时间格式,把 Date 对象转换为字符串。

 

原型:[Date].toLocaleDateString()
说明:根据本地时间格式,把 Date 对象的日期部分转换为字符串。

 

原型:[Date].toLocaleTimeString()
说明:根据本地时间把 Date 对象的时间部分转换为字符串

 

原型:[Date].valueOf()
说明:返回 Date 对象的原始值

 

原型:[Date].getTime()
说明:返回距 1970 年 1 月 1 日之间的毫秒数。

 

原型:[Date].getFullYear()
说明:从 Date 对象以四位数字返回年份。 

 

原型:[Date].getUTCFullYear()
说明:根据世界时 (UTC) 返回表年份的四位数字

 

原型:[Date].getMonth()
说明:返回表示月份的数字。返回值是 0(一月) 到 11(十二月) 之间的一个整数。

 

原型:[Date].getUTCMonth()
说明:返回一个表示月份的数字(按照世界时 UTC)。返回值是 0(一月) 到 11(十二月) 之间的一个整数。

 

原型:[Date].getDate()
说明:返回月份的某一天。返回值是 1 ~ 31 之间的一个整数。

 

原型:[Date].getUTCDate()
说明:根据世界时从 Date 对象返回月中的一天 (1 ~ 31)。    

 

原型:[Date].getDay()
说明:返回一周(0~6)的某一天的数字。星期天为 0, 星期一为 1, 以此类推。

 

原型:[Date].getUTCDay()
说明:根据世界时从 Date 对象返回周中的一天 (0 ~ 6)。

 

原型:[Date].getHours()
说明:返回时间的小时字段

 

原型:[Date].getUTCHours()
说明:根据世界时返回 Date 对象的小时 (0 ~ 23)。

 

原型:[Date].getMinute()
说明:返回 Date 对象的分钟 (0 ~ 59)。

 

原型:[Date].getUTCMinutes()
说明:根据世界时返回 Date 对象的分钟 (0 ~ 59)。

 

原型:[Date].getSeconds()
说明:返回 Date 对象的秒数 (0 ~ 59)。

 

原型:[Date].getUTCSeconds()
说明:根据世界时返回 Date 对象的秒钟 (0 ~ 59)。    

 

原型:[Date].getMilliseconds()
说明:返回 Date 对象的毫秒(0 ~ 999)。

 

原型:[Date].getUTCMilliseconds()
说明:根据世界时返回 Date 对象的毫秒(0 ~ 999)。

 

原型:[Date].getTimezoneOffset()
说明:返回本地时间与格林威治标准时间 (GMT) 的分钟差。

 

原型:[Date].setTime( millisec )
说明:以毫秒设置 Date 对象。
参数: millisec [必须 Number]
示例:
var d = new Date()
d.setTime(77771564221)
console.log( d ) // 表示1970/01/01 添加 77771564221 毫秒,并显示新的日期和时间:

 

原型:[Date].setMilliseconds( millisec )
说明:设置 Date 对象中的毫秒 (0 ~ 999)。即将日期的豪秒值设置为millisec值
参数:
millisec [必需 0 ~ 999] 

 

原型:[Date].setUTCMilliseconds( millisec ) 
说明:根据世界时设置 Date 对象中的毫秒 (0 ~ 999)。
参数:millisec [必需 0 ~ 999] 

 

原型:[Date].setSeconds( second ) 
说明:设置 Date 对象中的秒钟 (0 ~ 59)。
参数:second [必需 0 ~ 59] 

 

原型:[Date].setUTCSeconds( second )
说明:根据世界时设置 Date 对象中的秒钟 (0 ~ 59)
参数:millisec [必需 0 ~ 59] 

 

原型:[Date].setMinutes( minute ) 
说明:设置 Date 对象中的分钟 (0 ~ 59)。
参数:minute [必需 0 ~ 59] 

 

原型:[Date].setUTCMinutes( minute ) 
说明:根据世界时设置 Date 对象中的分钟 (0 ~ 59)。
参数:minute [必需 0 ~ 59] 

 

原型:[Date].setHours( hour ) 
说明:设置 Date 对象中的小时 (0 ~ 23)。
参数:hour [必需 0 ~ 23] 

 

原型:[Date].setUTCHours( hour ) 
说明:根据世界时设置 Date 对象中的小时 (0 ~ 23)。
参数:hour [必需 0 ~ 23] 

 

原型:[Date].setDate( day ) 
说明:设置 Date 对象中月的某一天 (1 ~ 31)。 (1 ~ 31)。
参数:day [必需 1 ~ 31] 

 

原型:[Date].setUTCDate( day ) 
说明:根据世界时设置 Date 对象中月份的一天 (1 ~ 31)。
参数:day [必需 1 ~ 31] 

 

原型:[Date].setMonth( month )
说明:设置 Date 对象中月份 (0 ~ 11)。
参数:month  [必需 0 ~ 11] 

 

原型:[Date].setUTCMonth( month )
说明:根据世界时设置 Date 对象中的月份 (0 ~ 11)。
参数:month  [必需 0 ~ 11] 

 

原型:[Date].setFullYear( year )
说明:设置 Date 对象中的年份(四位数字)。
参数:year  [必需] 

 

原型:[Date].setUTCFullYear( year )
说明:根据世界时设置 Date 对象中的年份(四位数字)。
参数:year  [必需] 

 

原型:[Date].toUTCString(  )
说明:根据世界时,把 Date 对象转换为字符串。

 

原型:[Date].toISOString()
说明:使用 ISO 标准返回字符串的日期格式。

 

原型:[Date].toJSON()    
说明:以 JSON 数据格式返回日期字符串。

 

【WXS数据类型】Date

标签:ToJson   ber   使用   一周   utc   对象   结构   value   名称   

原文地址:https://www.cnblogs.com/wm218/p/9912109.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!