UNPKG

seasun-util

Version:

JavaScript 软件开发工具包

23 lines (22 loc) 634 B
/** * 格式化模块 * @module format * */ /** * 格式化时间戳 * @param {number} time 时间戳 * @param {string} fmt 格式 * @return {String} * @example * formatTime(1700152449834) ===> 2023-11-17 00:34:09 */ export declare function formatTime(time: number | string | Date, fmt?: string): string; /** * 格式化现在的已过时间 * @param startTime {Date} 开始时间 * @return String * @example * formatPassTime(new Date(2022-01-01 00:00:00)) ===> 1年前 * formatPassTime(new Date(2021-21-01 10:00:00)) ===> 2月前 */ export declare function formatTimePass(startTime: Date | number | string): string;