The public API for Easy Timekeeping.
Get the name of the current phase of the day as a localised string.
Not to be confused with the four shifts, the phase of day relates to the daylight cycle. During the day phase, the scene lighting will be set to the day value. During the night, scene lighting is set to the night value. During dawn, lighting is gradually changed from the night to the day values, while during dusk, the lighting changes from the day to night values.
Returns string the localised name of the day phase.
This is one of the set [Dawn, Day, Dusk, Night]
, but localized.
Increment or decrement the time. You must be a GM to run this function.
time
time the time step to increment or decrement
Returns timeChangeData if the time was changed, otherwise false
.
Set the time. You must be a GM to run this function.
time
time the time to set
Returns timeChangeData if the time was changed, otherwise false
.
Gets the current time.
Returns timeAugmented the current time
Posts the current time to chat.
Factors a time object into game turns, shifts and days
totalMinutes
totalMinutes
number total elapsed minutes since 12am on day 0
Returns gameTurnTime totalMinutes
factored into game turns, shifts, days and weeks
A time object used for inputting time values to the Easy Timekeeping API
Type: Object
days
number days since day 0hours
number hour of the day in 24-hour time, range [0..23]minutes
number minute of the hour, range [0..59]
An augmented time object used when values are returned from the Easy Timekeeping API
Type: Object
days
number days since day 0hours
number hour of the day in 24-hour time, range [0..23]minutes
number minute of the hour, range [0..59]totalMinutes
number total elapsed minutes since 12am on day 0weekNumber
number 1-based number of 7-day weeks that have elapsed, including the current partial week.day
dayData additional metadata about the day of the week
Day data
Type: Object
index
number 1-based number of the day of the week, starting with Monday. Each week is fixed at 7 days.name
string the name of the current day of the week, based on the current world settings.
Time change object returned from the Easy Timekeeping API
Type: Object
oldTime
timeAugmented the previous timetime
timeAugmented the new time
Game turn time. This is used by the graphical clocks, and returned from API calls.
Type: Object
totalGameTurns
number total number of elapsed game turnsdays
number days since day 0shifts
number the current shift out of the 4 shifts per day. 0-based, range [0..3]turns
number the current game turn within the current shift. 0-based indexingday
dayData additional metadata about the day of the weekweekNumber
number 1-based number of 7-day weeks that have elapsed, including the current partial week.shiftName
string the name of the current shift, based on world settings.
Constants used in time calculations.
secondsPerDay
number The number of seconds in a day.minutesPerDay
number The number of minutes in a day.hoursPerDay
number The number of hours in a day.shiftsPerDay
number The number of shifts in a day.minutesPerShift
number The number of minutes in a shift.hoursPerShift
number The number of hours in a shift.daysPerWeek
number The number of days in a week.minutesPerTurn
number The number of minutes in a game turn. Will vary by current module settings.turnsPerShift
number The number of game turns per shift. Will vary by current module settings.turnsPerDay
number The number of game turns per day. Will vary by current module settings.