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:
game.Players.PlayerAdded:Connect(function(p) id = p.UserId end) wait(1) print(id) -- works local httpservice = game:GetService("HttpService") local url = "https://www.roblox.com/users/"..id.."/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); print(joindate)
Does anyone know how to get a player's join date in a string value?
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 os.date .
Example:-
local day = 60 * 60 * 24 -- seconds in a day game.Players.PlayerAdded:Connect(function(plr) local tm = os.time() - (day * plr.AccountAge) -- player join date in seconds local date = os.date("!*t", tm) -- convert seconds to date print(date.year .. "-" .. date.month .. "-" .. date.day) -- print date end)
Hope this helps.