Os.date() does not get me the exact time for 1 month/year

I want to achieve a system that gives the gui text the time for 1 month/year, the issue is that it does not give the text the time, i’ve used multiple calculators and even calculated it myself the seconds on how much a month/year has, but everytime i try to do: os.date('%c',os.time()+timenumber) it does not give me the exact time on how it would be in one month (date time and etc the same just in one month/year), when you select the time via textbutton it saves the time into a separate table from where the gui can access it:
Time table:

local TimeTable = {
	OneDay = 86400,
	OneWeek = 604800,
	OneMonth = 2628000,
	OneYear = 31540000
}

DataTable :

local DataTable = {
	Thumbnail = "asdasdasd",
	Username = "asdasdasda",
	TempBanLength = TimeTable.OneDay
}

The way it works is if you press continue on the gui, it will put the TempBanLength from the DataTable into the gui text (the gui also has a button which will change the amount on how long the ban would be), like this:

TextLabel.Text = "Banned until:\n"..os.date("%c",os.time()+DataTable.TempBanLength)

And as stated, the problem is that it does not give me the exact time, as seen here:
image image

I don't know what to do anymore.

1 Like

I just did a quick search on google for seconds in a single month, and it returns

1 minute = 60 seconds

1 hour = 60 minutes = 60 x 60 = 3,600 seconds

1 day = 24 hours = 24 x 3,600 = 86,400 seconds

Here is where the answer diverges.

For a month with 31 days: 31 x 86,400 = 2,678,400 seconds

For a month with 30 days: 30 x 86,400 = 2,592,000 seconds

For February of a leap year: 29 x 86,400 = 2,505,600 seconds

For other Februarys: 28 x 86,400 = 2,419,200 seconds

Which may be a part of the issue with your script?

2 Likes