"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function toDateAndTime(timestamp) {
    const date = asDateStructure(timestamp).withLeadingZeros;
    return `${date.year}-${date.month}-${date.day} ${date.hour}:${date.minute}:${date.second}.${date.ms}`;
}
exports.toDateAndTime = toDateAndTime;
function toTime(timestamp) {
    const date = asDateStructure(timestamp).withLeadingZeros;
    return `${date.hour}:${date.minute}:${date.second}.${date.ms}`;
}
exports.toTime = toTime;
function asDateStructure(timestamp) {
    const date = new Date(timestamp);
    const leadingZero = (value) => {
        if (value <= 9) {
            return `0${value}`;
        }
        return `${value}`;
    };
    return {
        withLeadingZeros: {
            year: leadingZero(date.getFullYear()),
            month: leadingZero(date.getMonth() + 1),
            day: leadingZero(date.getDate()),
            hour: leadingZero(date.getHours()),
            minute: leadingZero(date.getMinutes()),
            second: leadingZero(date.getSeconds()),
            ms: leadingZero(date.getMilliseconds()),
        },
        simple: {
            year: date.getFullYear().toString(),
            month: (date.getMonth() + 1).toString(),
            day: date.getDate().toString(),
            hour: date.getHours().toString(),
            minute: date.getMinutes().toString(),
            second: date.getSeconds().toString(),
            ms: date.getMilliseconds().toString(),
        },
    };
}
exports.asDateStructure = asDateStructure;
//# sourceMappingURL=TimeStamp.js.map