================
@@ -156,16 +157,34 @@ async function getDAPArguments(
     .get<string[]>("arguments", []);
 }
 
+/**
+ * Formats the given date as a string in the form "YYYYMMdd".
+ *
+ * @param date The date to format as a string.
+ * @returns The formatted date.
+ */
+function formatDate(date: Date): string {
+    const year = date.getFullYear().toString().padStart(4, "0");
+    const month = (date.getMonth() + 1).toString().padStart(2, "0");
+    const day = date.getDate().toString().padStart(2, "0");
+    const hour = date.getHours().toString().padStart(2, "0");
+    const minute = date.getMinutes().toString().padStart(2, "0");
+    const seconds = date.getSeconds().toString().padStart(2, "0");
+    return year + month + day + hour + minute + seconds;
----------------
bkhouri wrote:

suggestion: although I don't think it's a standard, I have see the following 
syntax used previously, `yyyymmddThhmmss` where a hardcoded `T` is placed 
before the time.

e.g.: `20250107T140034` would represent January 7, 2027 at 2:00:34pm.  

This might help clarify the digits are are date/time, wherever they appear.

https://github.com/llvm/llvm-project/pull/146884
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to