Date and time
STTime gives the real date and time in UTC. Use it for daily rewards, cooldowns that last across visits, and events
that start at a set time. Times are Unix seconds: seconds since 1 January 1970 UTC, as a double.
StageTime takes the time from its server when the player signs in, so changing the device's clock doesn't change it.
STTime.isServerTime tells you which you have: it is false for a moment after StageTime starts, when offline and in
Build & Test, and the time then comes from the device.
| API | |
|---|---|
STTime.utcNow | Now, in Unix seconds |
STTime.utcDay | Today's day number (days since 1 January 1970). It changes at midnight UTC |
STTime.isServerTime | True when the time comes from StageTime's server |
STTime.localUtcOffsetHours | The device's time zone, for showing local times (utcNow + offset * 3600) |
STTime.Year(t), Month(t), Day(t), Hour(t), Minute(t), Second(t) | Parts of a time (UTC) |
STTime.DayOfWeek(t) | 0 Sunday … 6 Saturday |
STTime.DayNumber(t) | The day number of a time |
STTime.FromUtc(year, month, day, hour, minute, second) | A UTC date as Unix seconds |
STTime.DaysInMonth(year, month) | 28 to 31 |
STTime.ToIsoString(t) | Text such as 2026-11-22T20:05:00Z |
// Opens a door only during the weekly Friday 8 pm UTC show.
public GameObject showDoor;
private double showStart;
void Start()
{
showStart = STTime.FromUtc(2026, 11, 27, 20, 0, 0);
}
void Update()
{
double sinceStart = (STTime.utcNow - showStart) % (7 * 86400.0);
showDoor.SetActive(sinceStart >= 0 && sinceStart < 2 * 3600.0);
}
For anything inside a room (timers, music sync, rounds), use Networking.GetServerTimeInSeconds(): it is the same on
every device to the millisecond. STTime is for real-world dates.
The Clock board example shows the time, a countdown to the daily reset and the player's
worldPlayerId.