Skip to content

Commit

Permalink
Add Date class for WasmJSMain: Represents epoch time in milliseconds …
Browse files Browse the repository at this point in the history
…for JS env. Provides `getTime` method for UTC timestamp since 1970-01-01. Instantiate via platform-specific methods.
  • Loading branch information
ForteScarlet committed Sep 3, 2024
1 parent a68db14 commit a1d2e6e
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,15 @@

package love.forte.simbot.common.time


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

0 comments on commit a1d2e6e

Please sign in to comment.