How to get a player's exact roblox join date (month, day, and year)

I am making a game dependent on knowing which year, month, and day a player joined created so how could I do this accurately, because accountage isn’t accurate

1 Like
game.Players.PlayerAdded:Connect(function(Player)
	local joinTime = os.time() - (Player.AccountAge*86400)
	local joinDate = os.date("!*t", joinTime)

	print(joinDate.day, joinDate.month, joinDate.year)
end)

It actually is…

1 Like

i just tested it and its a day off (im trying to make a anniversary firework show when someone joins on their anniversary)

what is your account age so i can verify and if it is off by a day its likely because of timezones, you’d have to convert that by adding a timezone offset.

my accountage is 3475 and i believe i joined on jan 1, 2017

So what you just asked for was likely Timezone compensation, i just made one for you right now.

LocalScript - StarterPlayerScripts

local Players = game:GetService("Players")

local LocalPlayer = Players.LocalPlayer

local now = os.time()
local utcTime = os.time(os.date("!*t", now))
local localTime = os.time(os.date("*t", now))
local offsetSeconds = localTime - utcTime

local joinTime = os.time() - (LocalPlayer.AccountAge * 86400)
local joinDate = os.date("*t", joinTime + offsetSeconds)

print(joinDate.day, joinDate.month, joinDate.year)

can this be on the serverside as well?

With PlayerAdded, you can put it in the server yes

its still delayed by a day from my testing

1 Like