diff --git a/scripts/release/get-formatted-date.js b/scripts/release/get-formatted-date.js index 21b96e12c..0d7c40c8a 100644 --- a/scripts/release/get-formatted-date.js +++ b/scripts/release/get-formatted-date.js @@ -1,8 +1,11 @@ // TODO: Implement this in `utils.js` when jest.importActual is landed. export default function getFormattedDate() { const date = new Date(); - const year = date.getFullYear(); - const month = String(date.getMonth() + 1).padStart(2, "0"); - const day = String(date.getDate()).padStart(2, "0"); + const isoStr = date.toISOString(); + + const year = isoStr.slice(0, 4); + const month = isoStr.slice(5, 7); + const day = isoStr.slice(8, 10); + return { year, month, day }; }