URL url=new URL("http://www.bjtime.cn");//取得资源对象
       URLConnection uc=url.openConnection();//生成连接对象
       uc.connect(); //发出连接
       long ld=uc.getDate(); //取得网站日期时间
       Date date=new Date(ld); //转换为标准时间对象
这段代码用于获取准确的北京时间(也就是东八区区时)

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-16
  • 2021-11-22
  • 2021-10-27
  • 2021-08-26
猜你喜欢
  • 2021-11-22
  • 2021-06-09
  • 2021-09-18
  • 2022-02-06
  • 2022-12-23
  • 2022-01-09
  • 2022-01-13
相关资源
相似解决方案