Your browser does not support HTML5 canvas. Fork me on GitHub

Available Packages:

Time

Source

function duration.ago() returns instant

Source

Instant constructor.

function duration.display(string prefix) returns string

Source

Tranform a duration to a short string. Example: 61..minutes().display("T-") > "T-1H1M0S"

function duration.display() returns string

Source

ISO-8601 compatible duration representation. Example: 61..minutes().display() > "PT1H1M0S"

function duration.displayVerbose() returns string

Source

Tranform a duration to a verbose string. Example: 61..seconds().displayVerbose() > "1 minutes, and 1 seconds"

function instant.displayVerbose(string suffix) returns string

Source

Transform an instant to a verbose string. Example: instantNow().displayVerbose(" passed before the zombies killed you") > "5 minutes, and 0 seconds passed before the zombies killed you"

function instant.displayVerbose() returns string

Source

Transform an instant to a verbose string. Example: "Time elapsed: " + instantNow().displayVerbose() > "Time elapsed: 5 minutes, and 0 seconds game time"

function duration(real seconds) returns duration

Source

A duration of time. Use constructors like `6..seconds() or `15..minutes()` for convenience.

function durationFromIndex(int index) returns duration

Source

function instant.durationSince() returns duration

Source

Provides duration since an instant. Equivalent to Now - instant.

function durationToIndex(duration dur) returns int

Source

function instant.durationUntil() returns duration

Source

Provides duration until an instant. Convenience for the negative of durationSince.

function duration.fromNow() returns instant

Source

Instant constructor.

function duration.greaterThan(duration other) returns boolean

Source

Duration > duration ?

function real.hours() returns duration

Source

Duration constructor.

function int.hours() returns duration

Source

Duration constructor.

function real.hoursAgo() returns instant

Source

Instant constructor.

function int.hoursAgo() returns instant

Source

Instant constructor.

function real.hoursFromNow() returns instant

Source

Instant constructor.

function int.hoursFromNow() returns instant

Source

Instant constructor.

function instant(real timestamp_seconds) returns instant

Source

An instant in time. Use `instantNow()` to produce an instant from the current game time.

function instantFromIndex(int index) returns instant

Source

function instantNow() returns instant

Source

Instant constructor. Uses the elapsed game time.

function instantToIndex(instant inst) returns int

Source

function instant.isInTheFuture() returns boolean

Source

Convenience for checking if an instant comes after instantNow.

function instant.isInThePast() returns boolean

Source

Convenience for checking if an instant comes before instantNow.

function instant.isNewerThan(instant other) returns boolean

Source

Instant < instant ?

function instant.isOlderThan(instant other) returns boolean

Source

Instant > instant ?

function duration.lessThan(duration other) returns boolean

Source

Duration < duration ?

function real.minutes() returns duration

Source

Duration constructor.

function int.minutes() returns duration

Source

Duration constructor.

function real.minutesAgo() returns instant

Source

Instant constructor.

function int.minutesAgo() returns instant

Source

Instant constructor.

function real.minutesFromNow() returns instant

Source

Instant constructor.

function int.minutesFromNow() returns instant

Source

Instant constructor.

function instant.op_minus(duration dur) returns instant

Source

Compute an instant minus a duration. (Now minus 5 minutes = an instant 5 minutes in the past).

function instant.op_minus(instant other) returns duration

Source

Compute an instant minus an instant. (Now minus 5 minutes ago = 5 minutes).

function duration.op_minus(duration other) returns duration

Source

Compute a duration minus a duration. (5 minutes minus 2 minutes = 3 minutes).

function instant.op_plus(duration dur) returns instant

Source

Compute an instant plus a duration. (Now plus 5 minutes = an instant 5 minutes in the future).

function duration.op_plus(duration other) returns duration

Source

Compute a duration plus a duration. (5 minutes plus 5 minutes = 10 minutes).

function duration.op_plus(instant when) returns instant

Source

Compute a duration plus an instant. (5 minutes plus now = 5 minutes in the future).

function real.seconds() returns duration

Source

Duration constructor.

function int.seconds() returns duration

Source

Duration constructor.

function real.secondsAgo() returns instant

Source

Instant constructor.

function int.secondsAgo() returns instant

Source

Instant constructor.

function real.secondsFromNow() returns instant

Source

Instant constructor.

function int.secondsFromNow() returns instant

Source

Instant constructor.