Skip to content

Commit a1d2e6e

Browse files
committed
Add Date class for WasmJSMain: Represents epoch time in milliseconds for JS env. Provides getTime method for UTC timestamp since 1970-01-01. Instantiate via platform-specific methods.
1 parent a68db14 commit a1d2e6e

File tree

1 file changed

+9
-1
lines changed
  • simbot-commons/simbot-common-core/src/wasmJsMain/kotlin/love/forte/simbot/common/time

1 file changed

+9
-1
lines changed

simbot-commons/simbot-common-core/src/wasmJsMain/kotlin/love/forte/simbot/common/time/Date.kt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,15 @@
2323

2424
package love.forte.simbot.common.time
2525

26-
26+
/**
27+
* Represents a date object capable of providing the current epoch time in milliseconds.
28+
* This class is designed to work with JavaScript environments and provides a bridge
29+
* to access the `getTime` method which retrieves the number of milliseconds since
30+
* January 1, 1970, 00:00:00 UTC.
31+
*
32+
* Due to its external nature, instances of this class should be obtained through
33+
* platform-specific methods rather than instantiated directly.
34+
*/
2735
internal external class Date : JsAny {
2836
fun getTime(): Double
2937
}

0 commit comments

Comments
 (0)