We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cac5e1d commit f7fbe9aCopy full SHA for f7fbe9a
basic/integer_to_time.js
@@ -0,0 +1,14 @@
1
+// Assume you have a big integer for time in milliseconds
2
+const bigIntTime = 1672531199000n; // JavaScript BigInt, for example
3
+
4
+// Convert BigInt to regular number if it's safe (less than MAX_SAFE_INTEGER)
5
+const timeInMilliseconds = Number(bigIntTime);
6
7
+// Create a Date object from the milliseconds
8
+const date = new Date(timeInMilliseconds);
9
10
+// Format the date to a readable format
11
+const formattedDate = date.toISOString(); // "2023-01-01T00:59:59.000Z"
12
13
+console.log(formattedDate);
14
0 commit comments