思路:toLocalString()这个方法

<body>
    <%
    	long t=session.getLastAccessedTime();
    	long t2=session.getCreationTime();
     %>

    
     <h1>会话最近访问时间:<%=new Date(t).toLocaleString() %></h1>
     <h1>会话创建时间:<%=new Date(t2).toLocaleString() %></h1>
     <h1>在线时长:<%=(t-t2)/1000 %></h1>
  </body>

  

相关文章:

  • 2022-02-25
  • 2022-02-17
  • 2021-08-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-20
  • 2022-12-23
猜你喜欢
  • 2022-02-09
  • 2022-12-23
  • 2022-12-23
  • 2021-08-22
  • 2022-12-23
  • 2021-11-24
相关资源
相似解决方案