学习笔记→JS时间类型ToString()

来源:互联网 发布:sql select null as 编辑:程序博客网 时间:2024/06/07 20:11

var date = new Date();

//2014-04-22 11:17

date.toDateString

Tue Apr 22 2014

date.toGMTString()
Tue, 22 Apr 2014 03:17:02 GMT 

date.toLocaleDateString()
2014年4月22日 

date.toLocaleString()
2014年4月22日 上午11:17:02 

date.toLocaleTimeString()
上午11:17:02 

date.toString()
Tue Apr 22 2014 11:17:02 GMT+0800 (中国标准时间) 

date.toTimeString()
11:17:02 GMT+0800 (中国标准时间) 

date.toUTCString()
Tue, 22 Apr 2014 03:17:02 GMT

0 0
原创粉丝点击