I've tried everything. I've tried devforum posts (an unknown territory for me xD), for example,
which provided these module scripts, and they DO work, but I could not figure out how to subtract the date. First
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.
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 .
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.