'Get the date and don't update it

I want to display the user's information after logging in to the application "You log out after 8 hours", but I don't want to show 8 hours as text, but I want to show hour when user login + 8 hours. I use below code but time is update when page is refrech.

  var dt = new Date();
  var time = setHours(dt.getHours()+8);


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source