URL urlTime=new URL("http://www.bjtime.cn");//取得资源对象 URLConnection uc=urlTime.openConnection();//生成连接对象 uc.connect(); //发出连接 long ld=uc.getDate(); //取得网站日期时间 Date date=new Date(ld); //转换为标准时间对象 在uc.getDate();处报异常,此方法是不是不能直接用?
认证高级PHP讲师
URLConnection getDate method returns the time when the original server message was sent, not the standard network time. The getDate method itself does not throw an exception. What exception did you encounter?
URLConnection getDate method returns the time when the original server message was sent, not the standard network time. The getDate method itself does not throw an exception. What exception did you encounter?