Added timestamps with socket.io's handshake object which gives a lot of information back including the date of creation of said handshake as a string, formatted it into a date, used the new Date(); object with it's .toLocaleTimeString();function since it does the job for us: Formats the date to the local user's time and the devices time format. Made sure that the user sending the message doesn't get the handshake from the server but instead just makes a date object and appends it to his chat message.
Added timestamps with socket.io's handshake object which gives a lot of information back including the date of creation of said handshake as a string, formatted it into a date, used the
new Date();
object with it's.toLocaleTimeString();
function since it does the job for us: Formats the date to the local user's time and the devices time format. Made sure that the user sending the message doesn't get the handshake from the server but instead just makes a date object and appends it to his chat message.