Skip to main content
Version: 0.4.1

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.utcNowNow, in Unix seconds
STTime.utcDayToday's day number (days since 1 January 1970). It changes at midnight UTC
STTime.isServerTimeTrue when the time comes from StageTime's server
STTime.localUtcOffsetHoursThe 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);
}
Room time or real time?

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.