UNPKG

@550w-tools/core

Version:

550w-tools 核心库,暴露若干API供应用层调用

21 lines 708 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.formatDate = void 0; function formatDate(date) { const dateFormatter = new Intl.DateTimeFormat('en-US', { year: 'numeric', month: '2-digit', day: '2-digit', }); const timeFormatter = new Intl.DateTimeFormat('en-US', { hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: false, }); const formattedDate = dateFormatter.format(date).replace(/\//g, ''); const formattedTime = timeFormatter.format(date).replace(/:/g, ''); return `${formattedDate}${formattedTime}`; } exports.formatDate = formatDate; //# sourceMappingURL=date.js.map