Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "date"

时间相关的帮助方法

Index

Functions

Functions

formatDate

  • formatDate(date: number | Date, options?: undefined | object): string
  • 时间或时间戳转换成 YYYY-mm-DD HH:MM:SS

    example
    formatDate(1575370479028) // => '2019-12-03'
    formatDate(1575370479028,{ showTime: true }) // => '2019-12-03 18:54'

    Parameters

    • date: number | Date

      时间

    • Optional options: undefined | object

      showTime: 是否显示时间;showSec: 是否显示秒数

    Returns string

Generated using TypeDoc