Class

TimeHelper

TimeHelper()

Contains useful methods for manipulating time responses from the Slay the Spire time server from TimeLookup. This is a static class and should not be instantiated using the `new` keyword

Methods

# static DaysSince1970(timeInSeconds) → {number}

Get the number of days since 1970. This is how Slay the Spire generates seeds for the daily climb
Parameters:
Name Type Description
timeInSeconds number Number of seconds since January 1, 1970 at 00:00:00

View Source SlayTheSpireAPI/TimeServerHelpers/TimeHelper.ts, line 19

number
Example
const timeServerQuery = new TimeLookup();
const timeServerResponse = await timeServerQuery.execute();
const rngSeed = TimeHelper.DaysSince1970(timeServerResponse);