How to get accounts creation date in days

I’m making a game and I want to have a part where it shows the user privately its account age like this:
“Your account is {x amount in days} old”
can anyone give me some code for this, as I cannot find anything for it…

2 Likes

Isn’t the player’s account age property already in days?

See: Player | Roblox Creator Documentation

1 Like

I’m pretty sure in a local script it would be something like,

local plr = game.Players.LocalPlayer

local AccAge = plr.AccountAge

script.Parent.Text = AccAge
1 Like

is there any extremely short versions of that?

1 Like

I’m sorry, but i’m pretty certain this is the shortest way, as long as its in a local script.

2 Likes

you could just cut the variables I guess.

script.Parent.Text = game.Players.LocalPlayer.AccountAge
1 Like
local part = Instance.new("Part")
part.Parent = workspace
part.Anchored = true
part.Position = Vector3.new(0, 30, 0)
part.Size = Vector3.new(40, 40, 40)

local surfaceGui = Instance.new("SurfaceGui")
surfaceGui.Parent = part
local frame = Instance.new("Frame")
frame.Parent = surfaceGui
frame.Size = UDim2.fromScale(1, 1)
local textLabel = Instance.new("TextLabel")
textLabel.Size = UDim2.fromScale(0.5, 0.5)
textLabel.Position = UDim2.fromScale(0.25, 0.25)
textLabel.TextSize = 30
textLabel.Parent = surfaceGui

game.Players.PlayerAdded:Connect(function(player)
	textLabel.Text = player.Name..[[ was the last player to join,
	their account is ]]..player.AccountAge..[[ days old!]]
end)

image

Just a sample, obviously you can style the Gui on the BasePart instance and change whatever necessary.