Defines the cw.time and cw.date libraries, accessors for the in-game clock and calendar.

The server holds the values and exports them for saving with GetSaveData. The client reads the networked minute, hour, day and date and formats the time with a 12 or 24 hour clock.

Summary

Methods

GetDay()shared
Returns the in-game day of the week.
Returns the name of the in-game day of the week.
GetHour()shared
Returns the in-game hour, from 0 to 23.
Returns the in-game minute.
Returns the in-game time as a table for saving.
Returns the in-game time formatted for display.

Methods

Returns the in-game day of the week.

On the client this reads the day global net variable.

Returns

  • Number The day index, 1 when unknown

Returns the name of the in-game day of the week.

Names come from the default_days option.

Returns

  • String The day name (often a language phrase), #UnknownDay for an unnamed day, or nil if the option is not set

Returns the in-game hour, from 0 to 23.

On the client this reads the hour global net variable.

Returns

  • Number The hour, 0 when unknown

Returns the in-game minute.

On the client this reads the minute global net variable.

Returns

  • Number The minute, 0 when unknown

Returns the in-game time as a table for saving.

Returns

  • Map Table with minute, hour and day keys

Returns the in-game time formatted for display.

Uses a 12-hour clock with an am/pm suffix when the player's twelve-hour clock setting is on, otherwise HH:MM.

Returns

  • String The formatted time

Defined in