Skip to main content

Time

Types​

DateTimeLike​

type DateTimeLike = number | DateTime | string | nil

A unix timestamp in seconds (fractions are floored), a Roblox DateTime, an ISO 8601 string such as "2025-09-22T13:00:00Z", or nil for the current time.

TimeUnit​

type TimeUnit = "millisecond" | "second" | "minute" | "hour" | "day" | "week" | "month" | "quarter" | "year" | plurals | shorthands

A unit of time for Time.add, Time.subtract, Time.startOf and Time.endOf, singular or plural, or one of the shorthands ms, s, m, h, d, D, w, M, Q and y. date is another name for day.

TimeField​

type TimeField = "year" | "month" | "date" | "day" | "hour" | "minute" | "second" | "millisecond" | plurals | shorthands

A field of a time for Time.get and Time.set, singular or plural, or one of the shorthands y, M, D, d, h, m, s and ms. date is the day of the month and day is the day of the week (0 is Sunday). month runs 1-12.

Functions​

getDaysMonthTable​

Time.getDaysMonthTable(year: number) → {[number]: number}

Returns a Days in months table for the given year

getSecond​

Time.getSecond(currentTime: DateTimeLike) → number

Returns the second of the given time.

getMinute​

Time.getMinute(currentTime: DateTimeLike) → number

Returns the minute of the given time.

getHour​

Time.getHour(currentTime: DateTimeLike) → number

Returns the hour of the given time in 24-hour format.

getDay​

Time.getDay(currentTime: DateTimeLike) → number

Returns the day of the year (1-366) for the given time.

getYear​

Time.getYear(currentTime: DateTimeLike) → number

Returns the year for the given time.

getYearShort​

Time.getYearShort(currentTime: DateTimeLike) → number

Returns the last two digits of the year for the given time.

getYearShortFormatted​

Time.getYearShortFormatted(
currentTime: DateTimeLike,
locale: string?
) → string

Returns the last two digits of the year formatted as a string.

getMonth​

Time.getMonth(currentTime: DateTimeLike) → number

Returns the month (1-12) of the given time.

getFormattedMonth​

Time.getFormattedMonth(
currentTime: DateTimeLike,
locale: string?
) → string

Returns the month formatted as a two-digit string.

getDayOfTheMonth​

Time.getDayOfTheMonth(currentTime: DateTimeLike) → number

Returns the day of the month (1-31) for the given time.

getFormattedDayOfTheMonth​

Time.getFormattedDayOfTheMonth(
currentTime: DateTimeLike,
locale: string?
) → string

Returns the day of the month formatted as a two-digit string.

getMonthName​

Time.getMonthName(
currentTime: DateTimeLike,
locale: string?
) → string

Returns the full name of the month for the given time.

getMonthNameShort​

Time.getMonthNameShort(
currentTime: DateTimeLike,
locale: string?
) → string

Returns the abbreviated name of the month for the given time.

getJulianDate​

Time.getJulianDate(currentTime: DateTimeLike) → number

Returns the Julian day number for the given time.

getDayOfTheWeek​

Time.getDayOfTheWeek(currentTime: DateTimeLike) → number

Returns the day of the week as a number (0-6, starting on Sunday) for the given time.

getDayOfTheWeekName​

Time.getDayOfTheWeekName(
currentTime: DateTimeLike,
locale: string?
) → string

Returns the full name of the day of the week for the given time.

getDayOfTheWeekNameShort​

Time.getDayOfTheWeekNameShort(
currentTime: DateTimeLike,
locale: string?
) → string

Returns the abbreviated name of the day of the week for the given time.

getOrdinalOfNumber​

Time.getOrdinalOfNumber(
number: number,
locale: string?
) → string

Returns the localized ordinal suffix for a number, for example nd for 22 in English. See NumberLocalizationOrdinalUtils.getSuffix.

getDayOfTheMonthOrdinal​

Time.getDayOfTheMonthOrdinal(
currentTime: DateTimeLike,
locale: string?
) → string

Returns the localized ordinal suffix for the day of the month for the given time.

getFormattedSecond​

Time.getFormattedSecond(
currentTime: DateTimeLike,
locale: string?
) → string

Returns the second formatted as a two-digit string.

getFormattedMinute​

Time.getFormattedMinute(
currentTime: DateTimeLike,
locale: string?
) → string

Returns the minute formatted as a two-digit string.

getRegularHour​

Time.getRegularHour(currentTime: DateTimeLike) → number

Returns the hour in 12-hour format (1-12).

getHourFormatted​

Time.getHourFormatted(
currentTime: DateTimeLike,
locale: string?
) → string

Returns the hour formatted as a two-digit string in 24-hour format.

getRegularHourFormatted​

Time.getRegularHourFormatted(
currentTime: DateTimeLike,
locale: string?
) → string

Returns the hour formatted as a two-digit string in 12-hour format.

getamOrpm​

Time.getamOrpm(
currentTime: DateTimeLike,
locale: string?
) → string

Returns "am" or "pm" (or the locale's equivalent) based on the given time.

getAMorPM​

Time.getAMorPM(
currentTime: DateTimeLike,
locale: string?
) → string

Returns "AM" or "PM" (or the locale's equivalent) based on the given time.

getMilitaryHour​

Time.getMilitaryHour(
currentTime: DateTimeLike,
locale: string?
) → string

Reports the time in 24-hour format as a two-digit string.

isLeapYear​

Time.isLeapYear(currentTime: DateTimeLike) → boolean

Determines if the year of the given time is a leap year.

getDaysInMonth​

Time.getDaysInMonth(currentTime: DateTimeLike) → number

Returns the number of days in the month for the given time.

getUnixTimestamp​

Time.getUnixTimestamp(currentTime: DateTimeLike) → number

Returns the unix timestamp in seconds for the given time.

add​

Time.add(
currentTime: DateTimeLike,
value: number,
unit: TimeUnit
) → DateTime

Returns a DateTime moved forward by value units. Months, quarters and years move on the calendar and clamp the day, so January 31st plus a month is February 28th (or 29th); every other unit is a fixed offset. A negative value moves backwards.

Time.add("2025-01-31T00:00:00Z", 1, "month") --> 2025-02-28T00:00:00Z
Time.add(os.time(), 7, "days")

subtract​

Time.subtract(
currentTime: DateTimeLike,
value: number,
unit: TimeUnit
) → DateTime

Returns a DateTime moved back by value units. See Time.add.

startOf​

Time.startOf(
currentTime: DateTimeLike,
unit: TimeUnit
) → DateTime

Returns a DateTime at the first instant of the unit containing currentTime: startOf(t, "day") is midnight, startOf(t, "month") the 1st at midnight. Weeks start on Sunday.

Time.startOf("2025-09-22T13:45:30Z", "week") --> 2025-09-21T00:00:00Z

endOf​

Time.endOf(
currentTime: DateTimeLike,
unit: TimeUnit
) → DateTime

Returns a DateTime at the last millisecond of the unit containing currentTime: endOf(t, "day") is 23:59:59.999. See Time.startOf.

get​

Time.get(
currentTime: DateTimeLike,
field: TimeField
) → number

Reads one field of the given time.

Time.get("2025-09-22T13:45:30Z", "date") --> 22
Time.get("2025-09-22T13:45:30Z", "day") --> 1 (Monday)

set​

Time.set(
currentTime: DateTimeLike,
field: TimeField,
value: number
) → DateTime

Returns a DateTime with one field replaced. Values outside the field's range roll over the way JavaScript dates do: month 13 is January of the next year, date 0 is the last day of the previous month, hour 25 is 1am the next day. Setting day moves within the current week, so 0 is the preceding Sunday.

Time.set("2025-09-22T13:45:30Z", "date", 1) --> 2025-09-01T13:45:30Z
Time.set("2025-09-22T13:45:30Z", "day", 0) --> 2025-09-21T13:45:30Z

format​

Time.format(
format: string,
currentTime: DateTimeLike,
locale: string?
) → string

Formats the given time. The format string is passed to DateTime:FormatUniversalTime with the given locale, so every Roblox token works, for example "YYYY-MM-DD HH:mm:ss" or "dddd, MMMM D". On top of those, these tokens are available, for example "MMMM Do, YYYY" gives September 22nd, 2025. Their spellings avoid Roblox's own letters, so S (fractional seconds) and L (locale composites) keep their Roblox meaning.

Token Output
Do Day of the month as a localized ordinal, e.g. 22nd or 22e
DDDo Day of the year as a localized ordinal, e.g. 265th
t Days in the month, e.g. 30
LY Leap year, true or false
X Unix timestamp in seconds
J Julian day number

Wrap literal text in square brackets to keep it from being read as tokens: "[Today is] dddd" gives Today is Monday.

Defaults to the current time and the en-us locale.

setSecond​

Time.setSecond(
currentTime: DateTimeLike,
second: number
) → DateTime

Returns a DateTime with the second replaced. See Time.set.

setMinute​

Time.setMinute(
currentTime: DateTimeLike,
minute: number
) → DateTime

Returns a DateTime with the minute replaced. See Time.set.

setHour​

Time.setHour(
currentTime: DateTimeLike,
hour: number
) → DateTime

Returns a DateTime with the 24-hour hour replaced. See Time.set.

setRegularHour​

Time.setRegularHour(
currentTime: DateTimeLike,
hour: number
) → DateTime

Returns a DateTime with the 12-hour hour replaced, staying in the same half of the day, so setting 3 on a 13:45 time gives 15:45. 12 is midnight in the morning and noon in the afternoon.

setDay​

Time.setDay(
currentTime: DateTimeLike,
day: number
) → DateTime

Returns a DateTime with the day of the year (1-366) replaced, keeping the clock. A day past the end of the year rolls into the next one.

setYear​

Time.setYear(
currentTime: DateTimeLike,
year: number
) → DateTime

Returns a DateTime with the year replaced. See Time.set.

setMonth​

Time.setMonth(
currentTime: DateTimeLike,
month: number
) → DateTime

Returns a DateTime with the month (1-12) replaced. See Time.set.

setDayOfTheMonth​

Time.setDayOfTheMonth(
currentTime: DateTimeLike,
dayOfTheMonth: number
) → DateTime

Returns a DateTime with the day of the month replaced. See Time.set.

setDayOfTheWeek​

Time.setDayOfTheWeek(
currentTime: DateTimeLike,
dayOfTheWeek: number
) → DateTime

Returns a DateTime with the day of the week (0-6, starting on Sunday) replaced, moving within the current week. See Time.set.

setJulianDate​

Time.setJulianDate(
currentTime: DateTimeLike,
julianDate: number
) → DateTime

Returns a DateTime on the given Julian day number, keeping the clock.

Show raw api
{
    "functions": [
        {
            "name": "getDaysMonthTable",
            "desc": "Returns a Days in months table for the given year",
            "params": [
                {
                    "name": "year",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "{ [number]: number }\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 73,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "getSecond",
            "desc": "Returns the second of the given time.",
            "params": [
                {
                    "name": "currentTime",
                    "desc": "",
                    "lua_type": "DateTimeLike"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 88,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "getMinute",
            "desc": "Returns the minute of the given time.",
            "params": [
                {
                    "name": "currentTime",
                    "desc": "",
                    "lua_type": "DateTimeLike"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 95,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "getHour",
            "desc": "Returns the hour of the given time in 24-hour format.",
            "params": [
                {
                    "name": "currentTime",
                    "desc": "",
                    "lua_type": "DateTimeLike"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 102,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "getDay",
            "desc": "Returns the day of the year (1-366) for the given time.",
            "params": [
                {
                    "name": "currentTime",
                    "desc": "",
                    "lua_type": "DateTimeLike"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 109,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "getYear",
            "desc": "Returns the year for the given time.",
            "params": [
                {
                    "name": "currentTime",
                    "desc": "",
                    "lua_type": "DateTimeLike"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 116,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "getYearShort",
            "desc": "Returns the last two digits of the year for the given time.",
            "params": [
                {
                    "name": "currentTime",
                    "desc": "",
                    "lua_type": "DateTimeLike"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 123,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "getYearShortFormatted",
            "desc": "Returns the last two digits of the year formatted as a string.",
            "params": [
                {
                    "name": "currentTime",
                    "desc": "",
                    "lua_type": "DateTimeLike"
                },
                {
                    "name": "locale",
                    "desc": "",
                    "lua_type": "string?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "string\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 130,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "getMonth",
            "desc": "Returns the month (1-12) of the given time.",
            "params": [
                {
                    "name": "currentTime",
                    "desc": "",
                    "lua_type": "DateTimeLike"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 137,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "getFormattedMonth",
            "desc": "Returns the month formatted as a two-digit string.",
            "params": [
                {
                    "name": "currentTime",
                    "desc": "",
                    "lua_type": "DateTimeLike"
                },
                {
                    "name": "locale",
                    "desc": "",
                    "lua_type": "string?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "string\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 144,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "getDayOfTheMonth",
            "desc": "Returns the day of the month (1-31) for the given time.",
            "params": [
                {
                    "name": "currentTime",
                    "desc": "",
                    "lua_type": "DateTimeLike"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 151,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "getFormattedDayOfTheMonth",
            "desc": "Returns the day of the month formatted as a two-digit string.",
            "params": [
                {
                    "name": "currentTime",
                    "desc": "",
                    "lua_type": "DateTimeLike"
                },
                {
                    "name": "locale",
                    "desc": "",
                    "lua_type": "string?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "string\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 158,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "getMonthName",
            "desc": "Returns the full name of the month for the given time.",
            "params": [
                {
                    "name": "currentTime",
                    "desc": "",
                    "lua_type": "DateTimeLike"
                },
                {
                    "name": "locale",
                    "desc": "",
                    "lua_type": "string?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "string\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 165,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "getMonthNameShort",
            "desc": "Returns the abbreviated name of the month for the given time.",
            "params": [
                {
                    "name": "currentTime",
                    "desc": "",
                    "lua_type": "DateTimeLike"
                },
                {
                    "name": "locale",
                    "desc": "",
                    "lua_type": "string?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "string\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 172,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "getJulianDate",
            "desc": "Returns the Julian day number for the given time.",
            "params": [
                {
                    "name": "currentTime",
                    "desc": "",
                    "lua_type": "DateTimeLike"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 179,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "getDayOfTheWeek",
            "desc": "Returns the day of the week as a number (0-6, starting on Sunday) for the given time.",
            "params": [
                {
                    "name": "currentTime",
                    "desc": "",
                    "lua_type": "DateTimeLike"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 186,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "getDayOfTheWeekName",
            "desc": "Returns the full name of the day of the week for the given time.",
            "params": [
                {
                    "name": "currentTime",
                    "desc": "",
                    "lua_type": "DateTimeLike"
                },
                {
                    "name": "locale",
                    "desc": "",
                    "lua_type": "string?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "string\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 193,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "getDayOfTheWeekNameShort",
            "desc": "Returns the abbreviated name of the day of the week for the given time.",
            "params": [
                {
                    "name": "currentTime",
                    "desc": "",
                    "lua_type": "DateTimeLike"
                },
                {
                    "name": "locale",
                    "desc": "",
                    "lua_type": "string?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "string\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 200,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "getOrdinalOfNumber",
            "desc": "Returns the localized ordinal suffix for a number, for example `nd` for 22 in English.\nSee [NumberLocalizationOrdinalUtils.getSuffix].",
            "params": [
                {
                    "name": "number",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "locale",
                    "desc": "",
                    "lua_type": "string?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "string\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 208,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "getDayOfTheMonthOrdinal",
            "desc": "Returns the localized ordinal suffix for the day of the month for the given time.",
            "params": [
                {
                    "name": "currentTime",
                    "desc": "",
                    "lua_type": "DateTimeLike"
                },
                {
                    "name": "locale",
                    "desc": "",
                    "lua_type": "string?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "string\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 215,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "getFormattedSecond",
            "desc": "Returns the second formatted as a two-digit string.",
            "params": [
                {
                    "name": "currentTime",
                    "desc": "",
                    "lua_type": "DateTimeLike"
                },
                {
                    "name": "locale",
                    "desc": "",
                    "lua_type": "string?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "string\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 222,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "getFormattedMinute",
            "desc": "Returns the minute formatted as a two-digit string.",
            "params": [
                {
                    "name": "currentTime",
                    "desc": "",
                    "lua_type": "DateTimeLike"
                },
                {
                    "name": "locale",
                    "desc": "",
                    "lua_type": "string?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "string\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 229,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "getRegularHour",
            "desc": "Returns the hour in 12-hour format (1-12).",
            "params": [
                {
                    "name": "currentTime",
                    "desc": "",
                    "lua_type": "DateTimeLike"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 236,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "getHourFormatted",
            "desc": "Returns the hour formatted as a two-digit string in 24-hour format.",
            "params": [
                {
                    "name": "currentTime",
                    "desc": "",
                    "lua_type": "DateTimeLike"
                },
                {
                    "name": "locale",
                    "desc": "",
                    "lua_type": "string?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "string\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 243,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "getRegularHourFormatted",
            "desc": "Returns the hour formatted as a two-digit string in 12-hour format.",
            "params": [
                {
                    "name": "currentTime",
                    "desc": "",
                    "lua_type": "DateTimeLike"
                },
                {
                    "name": "locale",
                    "desc": "",
                    "lua_type": "string?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "string\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 250,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "getamOrpm",
            "desc": "Returns \"am\" or \"pm\" (or the locale's equivalent) based on the given time.",
            "params": [
                {
                    "name": "currentTime",
                    "desc": "",
                    "lua_type": "DateTimeLike"
                },
                {
                    "name": "locale",
                    "desc": "",
                    "lua_type": "string?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "string\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 257,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "getAMorPM",
            "desc": "Returns \"AM\" or \"PM\" (or the locale's equivalent) based on the given time.",
            "params": [
                {
                    "name": "currentTime",
                    "desc": "",
                    "lua_type": "DateTimeLike"
                },
                {
                    "name": "locale",
                    "desc": "",
                    "lua_type": "string?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "string\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 264,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "getMilitaryHour",
            "desc": "Reports the time in 24-hour format as a two-digit string.",
            "params": [
                {
                    "name": "currentTime",
                    "desc": "",
                    "lua_type": "DateTimeLike"
                },
                {
                    "name": "locale",
                    "desc": "",
                    "lua_type": "string?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "string\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 271,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "isLeapYear",
            "desc": "Determines if the year of the given time is a leap year.",
            "params": [
                {
                    "name": "currentTime",
                    "desc": "",
                    "lua_type": "DateTimeLike"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 278,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "getDaysInMonth",
            "desc": "Returns the number of days in the month for the given time.",
            "params": [
                {
                    "name": "currentTime",
                    "desc": "",
                    "lua_type": "DateTimeLike"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 286,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "getUnixTimestamp",
            "desc": "Returns the unix timestamp in seconds for the given time.",
            "params": [
                {
                    "name": "currentTime",
                    "desc": "",
                    "lua_type": "DateTimeLike"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 294,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "add",
            "desc": "Returns a `DateTime` moved forward by `value` units. Months, quarters and\nyears move on the calendar and clamp the day, so January 31st plus a month is February 28th\n(or 29th); every other unit is a fixed offset. A negative value moves backwards.\n\n```lua\nTime.add(\"2025-01-31T00:00:00Z\", 1, \"month\") --> 2025-02-28T00:00:00Z\nTime.add(os.time(), 7, \"days\")\n```",
            "params": [
                {
                    "name": "currentTime",
                    "desc": "",
                    "lua_type": "DateTimeLike"
                },
                {
                    "name": "value",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "unit",
                    "desc": "",
                    "lua_type": "TimeUnit"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "DateTime\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 416,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "subtract",
            "desc": "Returns a `DateTime` moved back by `value` units. See [Time.add].",
            "params": [
                {
                    "name": "currentTime",
                    "desc": "",
                    "lua_type": "DateTimeLike"
                },
                {
                    "name": "value",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "unit",
                    "desc": "",
                    "lua_type": "TimeUnit"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "DateTime\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 438,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "startOf",
            "desc": "Returns a `DateTime` at the first instant of the unit containing `currentTime`:\n`startOf(t, \"day\")` is midnight, `startOf(t, \"month\")` the 1st at midnight. Weeks\nstart on Sunday.\n\n```lua\nTime.startOf(\"2025-09-22T13:45:30Z\", \"week\") --> 2025-09-21T00:00:00Z\n```",
            "params": [
                {
                    "name": "currentTime",
                    "desc": "",
                    "lua_type": "DateTimeLike"
                },
                {
                    "name": "unit",
                    "desc": "",
                    "lua_type": "TimeUnit"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "DateTime\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 453,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "endOf",
            "desc": "Returns a `DateTime` at the last millisecond of the unit containing `currentTime`:\n`endOf(t, \"day\")` is 23:59:59.999. See [Time.startOf].",
            "params": [
                {
                    "name": "currentTime",
                    "desc": "",
                    "lua_type": "DateTimeLike"
                },
                {
                    "name": "unit",
                    "desc": "",
                    "lua_type": "TimeUnit"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "DateTime\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 485,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "get",
            "desc": "Reads one field of the given time.\n\n```lua\nTime.get(\"2025-09-22T13:45:30Z\", \"date\") --> 22\nTime.get(\"2025-09-22T13:45:30Z\", \"day\") --> 1 (Monday)\n```",
            "params": [
                {
                    "name": "currentTime",
                    "desc": "",
                    "lua_type": "DateTimeLike"
                },
                {
                    "name": "field",
                    "desc": "",
                    "lua_type": "TimeField"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 585,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "set",
            "desc": "Returns a `DateTime` with one field replaced. Values outside the field's\nrange roll over the way JavaScript dates do: month 13 is January of the next year, date 0 is\nthe last day of the previous month, hour 25 is 1am the next day. Setting `day` moves within\nthe current week, so 0 is the preceding Sunday.\n\n```lua\nTime.set(\"2025-09-22T13:45:30Z\", \"date\", 1) --> 2025-09-01T13:45:30Z\nTime.set(\"2025-09-22T13:45:30Z\", \"day\", 0) --> 2025-09-21T13:45:30Z\n```",
            "params": [
                {
                    "name": "currentTime",
                    "desc": "",
                    "lua_type": "DateTimeLike"
                },
                {
                    "name": "field",
                    "desc": "",
                    "lua_type": "TimeField"
                },
                {
                    "name": "value",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "DateTime\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 624,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "format",
            "desc": "Formats the given time. The format string is passed to\n[DateTime:FormatUniversalTime](https://create.roblox.com/docs/reference/engine/datatypes/DateTime#FormatUniversalTime)\nwith the given locale, so every Roblox token works, for example `\"YYYY-MM-DD HH:mm:ss\"`\nor `\"dddd, MMMM D\"`. On top of those, these tokens are available, for example\n`\"MMMM Do, YYYY\"` gives `September 22nd, 2025`. Their spellings avoid Roblox's own letters,\nso `S` (fractional seconds) and `L` (locale composites) keep their Roblox meaning.\n\n| Token | Output |\n| ----- | ------ |\n| `Do` | Day of the month as a localized ordinal, e.g. `22nd` or `22e` |\n| `DDDo` | Day of the year as a localized ordinal, e.g. `265th` |\n| `t` | Days in the month, e.g. `30` |\n| `LY` | Leap year, `true` or `false` |\n| `X` | Unix timestamp in seconds |\n| `J` | Julian day number |\n\nWrap literal text in square brackets to keep it from being read as tokens:\n`\"[Today is] dddd\"` gives `Today is Monday`.\n\nDefaults to the current time and the `en-us` locale.",
            "params": [
                {
                    "name": "format",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "currentTime",
                    "desc": "",
                    "lua_type": "DateTimeLike"
                },
                {
                    "name": "locale",
                    "desc": "",
                    "lua_type": "string?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "string\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 718,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "setSecond",
            "desc": "Returns a `DateTime` with the second replaced. See [Time.set].",
            "params": [
                {
                    "name": "currentTime",
                    "desc": "",
                    "lua_type": "DateTimeLike"
                },
                {
                    "name": "second",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "DateTime\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 758,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "setMinute",
            "desc": "Returns a `DateTime` with the minute replaced. See [Time.set].",
            "params": [
                {
                    "name": "currentTime",
                    "desc": "",
                    "lua_type": "DateTimeLike"
                },
                {
                    "name": "minute",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "DateTime\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 765,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "setHour",
            "desc": "Returns a `DateTime` with the 24-hour hour replaced. See [Time.set].",
            "params": [
                {
                    "name": "currentTime",
                    "desc": "",
                    "lua_type": "DateTimeLike"
                },
                {
                    "name": "hour",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "DateTime\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 772,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "setRegularHour",
            "desc": "Returns a `DateTime` with the 12-hour hour replaced, staying in the same half of the day, so\nsetting 3 on a 13:45 time gives 15:45. 12 is midnight in the morning and noon in the afternoon.",
            "params": [
                {
                    "name": "currentTime",
                    "desc": "",
                    "lua_type": "DateTimeLike"
                },
                {
                    "name": "hour",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "DateTime\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 780,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "setDay",
            "desc": "Returns a `DateTime` with the day of the year (1-366) replaced, keeping the clock. A day past\nthe end of the year rolls into the next one.",
            "params": [
                {
                    "name": "currentTime",
                    "desc": "",
                    "lua_type": "DateTimeLike"
                },
                {
                    "name": "day",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "DateTime\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 791,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "setYear",
            "desc": "Returns a `DateTime` with the year replaced. See [Time.set].",
            "params": [
                {
                    "name": "currentTime",
                    "desc": "",
                    "lua_type": "DateTimeLike"
                },
                {
                    "name": "year",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "DateTime\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 801,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "setMonth",
            "desc": "Returns a `DateTime` with the month (1-12) replaced. See [Time.set].",
            "params": [
                {
                    "name": "currentTime",
                    "desc": "",
                    "lua_type": "DateTimeLike"
                },
                {
                    "name": "month",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "DateTime\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 808,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "setDayOfTheMonth",
            "desc": "Returns a `DateTime` with the day of the month replaced. See [Time.set].",
            "params": [
                {
                    "name": "currentTime",
                    "desc": "",
                    "lua_type": "DateTimeLike"
                },
                {
                    "name": "dayOfTheMonth",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "DateTime\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 815,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "setDayOfTheWeek",
            "desc": "Returns a `DateTime` with the day of the week (0-6, starting on Sunday) replaced, moving\nwithin the current week. See [Time.set].",
            "params": [
                {
                    "name": "currentTime",
                    "desc": "",
                    "lua_type": "DateTimeLike"
                },
                {
                    "name": "dayOfTheWeek",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "DateTime\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 823,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "setJulianDate",
            "desc": "Returns a `DateTime` on the given Julian day number, keeping the clock.",
            "params": [
                {
                    "name": "currentTime",
                    "desc": "",
                    "lua_type": "DateTimeLike"
                },
                {
                    "name": "julianDate",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "DateTime\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 830,
                "path": "src/time/src/Shared/Time.lua"
            }
        }
    ],
    "properties": [],
    "types": [
        {
            "name": "DateTimeLike",
            "desc": "A unix timestamp in seconds (fractions are floored), a Roblox `DateTime`, an ISO 8601 string\nsuch as `\"2025-09-22T13:00:00Z\"`, or `nil` for the current time.",
            "lua_type": "number | DateTime | string | nil",
            "source": {
                "line": 19,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "TimeUnit",
            "desc": "A unit of time for [Time.add], [Time.subtract], [Time.startOf] and [Time.endOf], singular or\nplural, or one of the shorthands `ms`, `s`, `m`, `h`, `d`, `D`, `w`, `M`, `Q` and `y`.\n`date` is another name for `day`.",
            "lua_type": "\"millisecond\" | \"second\" | \"minute\" | \"hour\" | \"day\" | \"week\" | \"month\" | \"quarter\" | \"year\" | plurals | shorthands",
            "source": {
                "line": 306,
                "path": "src/time/src/Shared/Time.lua"
            }
        },
        {
            "name": "TimeField",
            "desc": "A field of a time for [Time.get] and [Time.set], singular or plural, or one of the\nshorthands `y`, `M`, `D`, `d`, `h`, `m`, `s` and `ms`. `date` is the day of the month and\n`day` is the day of the week (0 is Sunday). `month` runs 1-12.",
            "lua_type": "\"year\" | \"month\" | \"date\" | \"day\" | \"hour\" | \"minute\" | \"second\" | \"millisecond\" | plurals | shorthands",
            "source": {
                "line": 498,
                "path": "src/time/src/Shared/Time.lua"
            }
        }
    ],
    "name": "Time",
    "desc": "",
    "source": {
        "line": 5,
        "path": "src/time/src/Shared/Time.lua"
    }
}