Made a quick place that shows the last online date/time of Roblox users

Basically the title^. I’m not really sure if anyone made anything like this but just decided to quickly make it since the “last online” info was removed from the user search page back in the beginning of last year, or something like that. Using HttpService, I made it so that you chat a user’s username and then click the brick for the info to display on the bottom of the big white brick. Only thing I’m not satisfied with though is the organization of the date/time. For instance, it will say something along the lines of "This user was last online on 2018-07-08T10:30:14.4153821-05:00" No clue if there’s any efficient way for it to instead display that info in a bit more organized way, such as “July 07, 2018 at 10:30:14 a.m.” Would accept any thoughts/opinions regarding any of this.

Edit: I have added it.

Just wanted to share this small quick creation:

28 Likes

For the time, you can probably look into string patterns to figure out how to format it better.
Wiki page is down for me for it(?)

Anyhow, you can match it like this:

local Y, M, D, H, Mi, S = dateString:match('(%d+)%-(%d+)%-(%d+)T(%d+):(%d+):(%d+)')

The %d+ pattern matches a string of numbers grouped together, essentially getting each and omitting their respective separators (:/-/T) using captures ( ).
From there you can use the variables to form the new format via concatenation.
For the specific month name, you can always put them in an array and get the name as such:

local Month = monthArray[tonumber(M)]

String pattern documentation: https://www.lua.org/pil/20.2.html

8 Likes

This is amazing thank you so much

2 Likes

I really miss this feature on the site.
Thanks

What endpoint is this using?

2 Likes

This is a really nice place, thanks for making this:D

I think this is a problem on roblox’s end and not yours though: some of the info is incorrect. Out of curiosity, I checked a guy’s name who I friended when I first joined Roblox, on November 18th, 2007. At the very earliest, I would’ve friended him on that date. But it displays his ‘last online’ date as October 10th 2007, which is the date he joined Roblox but definitely not his last day online. Not sure why that’s the case.

You’re right that it’s on Roblox’s end. This information was displaying incorrectly for a lot of users before it was removed from the site. This may be one reason the feature was removed in the first place. Fixing it (if it is possible to fix cases which are already broken) isn’t worth the work just so users can see when someone was last online.

I checked my banned account and apparently it was logged onto this year …

I was terminated in 2014 lmao

I would recommend using a GUI rather than a Hint object, as the Hint object doesn’t work so well on mobile…

1 Like

Yeah, as well as the Hint object is deprecated and won’t be fixed if it breaks.

1 Like

Yeah, I was planning to make it a GUI when I first made the place but I ended up using a Hint object.

I just removed the Hint object and replaced it with the information being displayed on the SurfaceGui on the bottom of the white block. It should be mostly fine on mobile now (although I’m not too great at GUI design lol, but it is straightforward and simple).

1 Like

This is awesome! Thanks for making it. Can you explain how you did it? I have tried using HttpService, but it is restricted to non-Roblox sites. I also looked at JSON options in Roblox URLs, but the info is not as up-to-date as your solution.

I think he used a Roblox proxy.

I think what he is asking for and what I am curious about is which API he accessed.

1 Like

You can use https://api.roblox.com/users/USERID/onlinestatus/ to retrieve this information; I think it was @ ImSlappy826 or @ 3dsboy08 who let me know about it a while back.

6 Likes

Hi, I made something similar: “Friends List - Last Seen Online”. Shows your friends and when they were last online. This can be helpful to remove friends who have not played Roblox for months. It is great if you are at max friends. It helps you make room for new active friends. The dates shown seem to be correct as far as I can tell, but I can offer no guarantees. Note: If a date is in the future, that means it is tomorrow in their time zone. https://www.roblox.com/games/2915840535/Friends-List-Last-Seen-Online

4 Likes