Skip to content

giscafer/jquery.formatdate.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

jquery.formatdate.js

The date to formatting

formatDate

$.formatDate(new Date());
// => 2015-11-20

$.formatDate(new Date(),"yyyy年MM月dd日");
// =>  2015年11月20日

$.formatDate(new Date(),"yyyy-MM-dd HH:mm:ss");
// => 2015-11-20 14:41:17

$.formatDate(new Date(),"yyyy/MM/dd HH:mm:ss");
// => 2015/11/20 14:41:17

$.formatDate(new Date(),'yyyy-MM-dd h:m:s tt')
// => 2015-11-24 5:58:20 pm

$.formatDate(new Date(),'u')
// => 2015-11-24T17:59:28Z


$.formatDate(new Date(),'ddd')
// => 周二
$.formatDate(new Date(),'dddd')
// => 星期二
$.formatDate(new Date(),'dd')
// => 24
$.formatDate(new Date(),'d')
// => 24


$.formatDate(new Date(),'M')
// => "11"
$.formatDate(new Date(),'MM')
// => "11"
$.formatDate(new Date(),'MMM')
// => "十一月"
$.formatDate(new Date(),'MMMM')
// => "十一月"

$.formatDate(new Date(),'YYYY MMMM DDDD')
// => "二零一五年 十一月 二四日"

formatDates

$.formatDates(new Date(),new Date("2015/11/27"),"MMM d[ yyyy]{ '—'[ MMM] d yyyy}");
// => "十一月 20 — 十一月 27 2015"

About

the date to formatting(日期格式化插件)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published