UNPKG

ddl-manager

Version:

store postgres procedures and triggers in files

31 lines 941 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.date2timestamp = void 0; // timestamp for file name function date2timestamp(date) { let day = date.getDate().toString(); let month = (date.getMonth() + 1).toString(); const year = date.getFullYear().toString(); let hours = date.getHours().toString(); let minutes = date.getMinutes().toString(); let seconds = date.getSeconds().toString(); if (+day < 10) { day = "0" + day; } if (+month < 10) { month = "0" + month; } if (+hours < 10) { hours = "0" + hours; } if (+minutes < 10) { minutes = "0" + minutes; } if (+seconds < 10) { seconds = "0" + seconds; } // cannot use symbols for file name :|?*<>/\" return `${day}.${month}.${year}__${hours}.${minutes}.${seconds}`; } exports.date2timestamp = date2timestamp; //# sourceMappingURL=utils.js.map