Still have questions? Join our Discord server and get real time help.
Log in to vote

How to get player's join date?

Asked by 6 months ago
Edited 6 months ago

I've tried everything. I've tried devforum posts (an unknown territory for me xD), for example,

Getting the date and subtracting the player's account age from it

which provided these module scripts, and they DO work, but I could not figure out how to subtract the date. First

Second .

I also tried this post from here at scripting helpers:


but even this does not work. I updated the code a bit, with a "trust check" error:

    id = p.UserId
print(id) -- works
local httpservice = game:GetService("HttpService")
local url = """/profile"
local html = httpservice:GetAsync(url) -- added
local cut = [[<p class="stat%-title">Join Date</p>%S+<p class="rbx%-lead">(.-)</p>]]
local joindate = html:match(cut);

Error Message

Does anyone know how to get a player's join date in a string value?

Is there a reason you need to get the join date? Also why is id a global variable? When you can just put all this code into the event listener? incapaxx 3477 — 6mo
I slapped it together quickly to put it on here, and I want the join date for a dramatic effect :/ TheGreenSuperman 75 — 6mo
You can't send http requests to roblox so you'll need a proxy. incapaxx 3477 — 6mo

1 answer

Log in to vote
Answered by
kingdom5 5413 Trusted Snack Break Moderation Voter Community Moderator
6 months ago

You cannot use the HttpService on Roblox pages as this would be a way to ddos Roblox and you do not need to use the HttpService for this task at all.

The Player includes the AccountAge (in days) which you can use to work out the join date (or very close join date depending upon the server time).

To work this out you first need to convert days -> seconds then take this away from the current time (also in seconds). To convert this into a usable date you can now use .


local day = 60 * 60 * 24 -- seconds in a day

    local tm = os.time() - (day * plr.AccountAge) -- player join date in seconds
    local date ="!*t", tm) -- convert seconds to date

    print(date.year .. "-" .. date.month .. "-" .. -- print date

Hope this helps.

I always thought you needed string patterns thanks for this it's simpler incapaxx 3477 — 6mo
Thanks, this was way more simple than I thought! TheGreenSuperman 75 — 6mo

Answer this question