{"ScriptPreparationCode":"function expanded() {\r\n const now = new Date();\r\n\r\n const year = now.getFullYear();\r\n const month = String(now.getMonth() \u002B 1).padStart(2, \u00270\u0027); // Months are zero-based\r\n const day = String(now.getDate()).padStart(2, \u00270\u0027);\r\n\r\n const hours = String(now.getHours()).padStart(2, \u00270\u0027);\r\n const minutes = String(now.getMinutes()).padStart(2, \u00270\u0027);\r\n const seconds = String(now.getSeconds()).padStart(2, \u00270\u0027);\r\n const milliseconds = String(now.getMilliseconds()).padStart(3, \u00270\u0027);\r\n\r\n return \u0060${year}-${month}-${day}_${hours}${minutes}${seconds}.${milliseconds}\u0060;\r\n}\r\n\r\nfunction luxonDT() {\r\n const formattedDate = luxon.DateTime.now().toFormat(\u0022yyyy-MM-dd_HHmmss.SSS\u0022);\r\n return formattedDate;\r\n}\r\n\r\nfunction padZero(number, length) {\r\n return number.toString().padStart(length, \u00270\u0027);\r\n}\r\n\r\nconst MS_PER_SECOND = 1000;\r\nconst MS_PER_MINUTE = MS_PER_SECOND * 60;\r\nconst MS_PER_HOUR = MS_PER_MINUTE * 60;\r\nconst MS_PER_DAY = MS_PER_HOUR * 24;\r\n\r\nfunction formatUnixTimestamp() {\r\n let timestamp = Date.now();\r\n\r\n let totalDays = Math.floor(timestamp / MS_PER_DAY);\r\n let remainingMs = timestamp % MS_PER_DAY;\r\n\r\n // Calculate current time components\r\n const hours = Math.floor(remainingMs / MS_PER_HOUR);\r\n remainingMs %= MS_PER_HOUR;\r\n const minutes = Math.floor(remainingMs / MS_PER_MINUTE);\r\n remainingMs %= MS_PER_MINUTE;\r\n const seconds = Math.floor(remainingMs / MS_PER_SECOND);\r\n const milliseconds = remainingMs % MS_PER_SECOND;\r\n\r\n // Calculate current year\r\n let year = 1970;\r\n while (true) {\r\n const daysInYear = (year % 4 === 0 \u0026\u0026 year % 100 !== 0) || (year % 400 === 0) ? 366 : 365;\r\n if (totalDays \u003E= daysInYear) {\r\n totalDays -= daysInYear;\r\n year\u002B\u002B;\r\n } else {\r\n break;\r\n }\r\n }\r\n\r\n // Days in each month\r\n const daysInMonth = [31, (year % 4 === 0 \u0026\u0026 year % 100 !== 0) || (year % 400 === 0) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\r\n\r\n // Calculate current month\r\n let month = 0;\r\n while (totalDays \u003E= daysInMonth[month]) {\r\n totalDays -= daysInMonth[month];\r\n month\u002B\u002B;\r\n }\r\n month\u002B\u002B; // Convert month to 1-based index\r\n\r\n // Remaining days are the current day\r\n const day = totalDays \u002B 1; // Convert day to 1-based index\r\n\r\n // Helper function to pad numbers with leading zeros\r\n const pad = (num, size) =\u003E num.toString().padStart(size, \u00270\u0027);\r\n\r\n // Format the date string\r\n return \u0060${year}-${pad(month, 2)}-${pad(day, 2)}_${pad(hours, 2)}${pad(minutes, 2)}${pad(seconds, 2)}.${pad(milliseconds, 3)}\u0060;\r\n}\r\n","TestCases":[{"Name":"expanded script","Code":"expanded();","IsDeferred":false},{"Name":"Luxon script","Code":"luxonDT();","IsDeferred":false},{"Name":"fns","Code":"formatUnixTimestamp();","IsDeferred":false}]}