0.0.3 • Published 8 months ago

@xutil/date v0.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

Date 时间

x-date时间模块,可以单独安装使用。

📦 安装

  • 使用 npm 安装

    npm install @xutil/date -S
  • HTML直接引入

    <!DOCTYPE html>
       <html lang="en">
       <body>
          <script src="/dist/index-umd.js"></script>
          <script>
             console.log(XDate.parseTime(new Date()))
          </script>
       </body>
    </html>

🎨 使用

  • ESM导入使用

    // 全部引入
    import { parseTime } from "@xutil/date"
     console.log(parseTime(new Date()))
    
    // 按需引入
    import XDate from "@xutil/date"
     console.log(XDate.parseTime(new Date()))
  • RequireJS导入使用

    // 全部引入
    const XDate = require('@xutil/date')
    console.log(XDate.parseTime(new Date()))
    
    // 按需引入
    const { parseTime } = require('@xutil/date')
    console.log(parseTime(new Date()))

方法

    parseTime                       时间处理[new Date() => {y}年{m}月{d}日 {h}时{i}分{s}秒]
0.0.3

8 months ago

0.0.2

8 months ago

0.0.1

8 months ago