const a = (s, t = "yyyy-MM-dd HH:mm:ss") => {
  let e = s ? new Date(s) : /* @__PURE__ */ new Date();
  var r = {
    "M+": e.getMonth() + 1,
    "d+": e.getDate(),
    "H+": e.getHours(),
    "m+": e.getMinutes(),
    "s+": e.getSeconds(),
    "q+": Math.floor((e.getMonth() + 3) / 3),
    S: e.getMilliseconds()
  }, g = e.getFullYear().toString();
  g = g.length >= 4 ? g : "0000".substr(0, 4 - g.length) + g, /(y+)/.test(t) && (t = t.replace(RegExp.$1, (g + "").substr(4 - RegExp.$1.length)));
  for (var n in r)
    new RegExp("(" + n + ")").test(t) && (t = t.replace(RegExp.$1, RegExp.$1.length === 1 ? r[n] : ("00" + r[n]).substr(("" + r[n]).length)));
  return t;
};
export {
  a as dateFormat
};
