1.0.4 • Published 3 years ago
xingjingjie-format v1.0.4
xingjingjie-format
⬇️ Install
npm i xingjingjie-
🎨 Usage
const wofDate = require('xingjingjie-format')
console.log(wofDate.format('Y-m-d H:i:s'))
console.log(wofDate.format('Y/m/d'))
console.log(wofDate.format('Y/m/d H:i:s'))
💡 param
| keywords | desc |
|---|---|
| Y | 年 |
| m | 月 |
| d | 日 |
| H | 时 |
| i | 分 |
| s | 秒 |
语法:wofDate.format('随意组合')
举个栗子🌰
wofDate.format('YmdHis')
wofDate.format('Y-m-d H:i:s')
wofDate.format('Y/m/d')
wofDate.format('Y/m/d H:i:s')
wofDate.format('Y年m月d日 H:i:s')
wofDate.format('Y')
wofDate.format('m')
wofDate.format('d')
wofDate.format('H')
wofDate.format('i')
wofDate.format('s')🚀 CDN
https://unpkg.com/xingjingjie-format@1.0.1/dist/wofDate.js
<script src="https://unpkg.com/xingjingjie-format@1.0.1/dist/wofDate.js"></script>
<script>
console.log(wofDate.format('Y-m-d H:i:s'))
console.log(wofDate.format('Y/m/d'))
console.log(wofDate.format('Y/m/d H:i:s'))
</script>🔒 License
See the LICENSE file for license rights and limitations (MIT). Build: a7ebffa