// 抓取北京时间
URL url = new URL("https://time.tianqi.com");
// 连接到我们需要抓取时间的网址
URLConnection uc = url.openConnection();
uc.connect();
// 抓取北京时间,获取到的时间为long类型
long time = uc.getDate();
09-27
363
