Skip to main content

Date

Simple util that helps with managing dates and helps with getting certain days,months etc...

Functions

GetTodayInFormat

Date.GetTodayInFormat() → string--

Returns the formatted string

This function returns the current date in the format of mm/dd/yy

GetStringDate

Date.GetStringDate(
fillerstring,--

This is the string that will be inbetween every specifier you put.

...string--

The specifiers you want to add.

) → string--

Returns the formatted string

This function allows you to format a date in any way you want by using os.date() specifiers Example:

Date.GetStringDate("/","%m","%d","%y") -- Example value would be 06/12/25

MonthTextToNumber

Date.MonthTextToNumber(
monthstring--

Month that you would like to be switched to a number.

) → number--

The month number

Basic function that switchs a month's name to its number Example: June -> 6

MonthNumberToText

Date.MonthNumberToText(
monthnumber--

Month number that you would like to be switched to a name.

) → string--

The month name

Basic function that switchs a month's number to its name Example: 12 -> December

GetNextMonth

Date.GetNextMonth(
monthstring | number--

Month name or number

) → (
string,
number
)--

The next month's name and number

A function that returns the month after the specified month

GetPrevMonth

Date.GetPrevMonth(
monthstring | number--

Month name or number

) → (
string,
number
)--

The previous month's name and number

A function that returns the month before the specified month

IsLeapYear

Date.IsLeapYear(
yearnumber--

The year you want to check

) → boolean--

The boolean on if the year is a leap year

A function that returns a boolean on if the specified year is a leap year

GetDaysInMonth

Date.GetDaysInMonth(
monthstring | number,--

The month you want to get the days from

yearnumber--

The year (to check if it is a leap year)

) → number--

Amount of days in specified month

A function that returns the amount of days that is in the specified month and year Example: February 2024 would return 29

Show raw api
{
    "functions": [
        {
            "name": "GetTodayInFormat",
            "desc": "This function returns the current date in the format of mm/dd/yy",
            "params": [],
            "returns": [
                {
                    "desc": "Returns the formatted string",
                    "lua_type": "string"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 26,
                "path": "src/Date/init.luau"
            }
        },
        {
            "name": "GetStringDate",
            "desc": "This function allows you to format a date in any way you want by using [os.date()](https://create.roblox.com/docs/reference/engine/libraries/os#date) specifiers\nExample:\n```lua\nDate.GetStringDate(\"/\",\"%m\",\"%d\",\"%y\") -- Example value would be 06/12/25\n\n```",
            "params": [
                {
                    "name": "filler",
                    "desc": "This is the string that will be inbetween every specifier you put.",
                    "lua_type": "string"
                },
                {
                    "name": "...",
                    "desc": "The specifiers you want to add.",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "Returns the formatted string",
                    "lua_type": "string"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 50,
                "path": "src/Date/init.luau"
            }
        },
        {
            "name": "MonthTextToNumber",
            "desc": "Basic function that switchs a month's name to its number\nExample: June -> 6",
            "params": [
                {
                    "name": "month",
                    "desc": "Month that you would like to be switched to a number.",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "The month number",
                    "lua_type": "number"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 69,
                "path": "src/Date/init.luau"
            }
        },
        {
            "name": "MonthNumberToText",
            "desc": "Basic function that switchs a month's number to its name\nExample: 12 -> December",
            "params": [
                {
                    "name": "month",
                    "desc": "Month number that you would like to be switched to a name.",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "The month name",
                    "lua_type": "string"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 83,
                "path": "src/Date/init.luau"
            }
        },
        {
            "name": "GetNextMonth",
            "desc": "A function that returns the month after the specified month",
            "params": [
                {
                    "name": "month",
                    "desc": "Month name or number",
                    "lua_type": "string | number"
                }
            ],
            "returns": [
                {
                    "desc": "The next month's name and number",
                    "lua_type": "(string, number)"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 96,
                "path": "src/Date/init.luau"
            }
        },
        {
            "name": "GetPrevMonth",
            "desc": "A function that returns the month before the specified month",
            "params": [
                {
                    "name": "month",
                    "desc": "Month name or number",
                    "lua_type": "string | number"
                }
            ],
            "returns": [
                {
                    "desc": "The previous month's name and number",
                    "lua_type": "(string, number)"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 112,
                "path": "src/Date/init.luau"
            }
        },
        {
            "name": "IsLeapYear",
            "desc": "A function that returns a boolean on if the specified year is a leap year",
            "params": [
                {
                    "name": "year",
                    "desc": "The year you want to check",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "The boolean on if the year is a leap year",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 128,
                "path": "src/Date/init.luau"
            }
        },
        {
            "name": "GetDaysInMonth",
            "desc": "A function that returns the amount of days that is in the specified month and year\nExample: `February 2024` would return `29`",
            "params": [
                {
                    "name": "month",
                    "desc": "The month you want to get the days from",
                    "lua_type": "string| number"
                },
                {
                    "name": "year",
                    "desc": "The year (to check if it is a leap year)",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "Amount of days in specified month",
                    "lua_type": "number"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 138,
                "path": "src/Date/init.luau"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "Date",
    "desc": "Simple util that helps with managing dates and helps with getting certain days,months etc...",
    "source": {
        "line": 20,
        "path": "src/Date/init.luau"
    }
}