@gdjiami/jslib
Version:
Jiami FrontEnd helpers and Services
19 lines (18 loc) • 494 B
TypeScript
/**
* 时间相关的帮助方法
*/
/**
* 时间或时间戳转换成 YYYY-mm-DD HH:MM:SS
* @param date 时间
* @param options showTime: 是否显示时间;showSec: 是否显示秒数
*
* @example
* ```js
* formatDate(1575370479028) // => '2019-12-03'
* formatDate(1575370479028,{ showTime: true }) // => '2019-12-03 18:54'
* ```
*/
export declare function formatDate(date: number | Date, options?: {
showTime?: boolean;
showSec?: boolean;
}): string;