URL url=new URL("http://www.google.com");//取得资源对象
URLConnection uc=url.openConnection();//生成连接对象
uc.connect(); //发出连接
long ld=uc.getDate(); //取得网站日期时间
Date date=new Date(ld); //转换为标准时间对象
System.out.println(date);
URL url1=new URL("http://www.baidu.com");//取得资源对象
URLConnection uc1=url1.openConnection();//生成连接对象
uc1.connect(); //发出连接
long ld1=uc.getDate(); //取得网站日期时间
Date date2=new Date(ld1); //转换为标准时间对象
System.out.println(date2);
Date date1=new Date();
System.out.println(date1);