@credo-ts/core
Version:
<p align="center"> <br /> <img alt="Credo Logo" src="https://github.com/openwallet-foundation/credo-ts/blob/c7886cb8377ceb8ee4efe8d264211e561a75072d/images/credo-logo.png" height="250px" /> </p> <h1 align="center"><b>Credo - Core</b></h1
19 lines (16 loc) • 537 B
JavaScript
//#region src/modules/vc/util.ts
/**
* Formats an input date to w3c standard date format
* @param date {number|string} Optional if not defined current date is returned
*
* @returns {string} date in a standard format as a string
*/
const w3cDate = (date) => {
let result = /* @__PURE__ */ new Date();
if (typeof date === "number" || typeof date === "string") result = new Date(date);
const str = result.toISOString();
return `${str.substr(0, str.length - 5)}Z`;
};
//#endregion
export { w3cDate };
//# sourceMappingURL=util.mjs.map