June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
|
|
@ -6,19 +6,19 @@ import java.net.URLConnection;
|
|||
|
||||
|
||||
public class WebTime{
|
||||
public static void main(String[] args){
|
||||
try{
|
||||
URL address = new URL(
|
||||
"http://tycho.usno.navy.mil/cgi-bin/timer.pl");
|
||||
URLConnection conn = address.openConnection();
|
||||
BufferedReader in = new BufferedReader(
|
||||
new InputStreamReader(conn.getInputStream()));
|
||||
String line;
|
||||
while(!(line = in.readLine()).contains("UTC"));
|
||||
System.out.println(line.substring(4));
|
||||
}catch(IOException e){
|
||||
System.err.println("error connecting to server.");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
public static void main(String[] args){
|
||||
try{
|
||||
URL address = new URL(
|
||||
"http://tycho.usno.navy.mil/cgi-bin/timer.pl");
|
||||
URLConnection conn = address.openConnection();
|
||||
BufferedReader in = new BufferedReader(
|
||||
new InputStreamReader(conn.getInputStream()));
|
||||
String line;
|
||||
while(!(line = in.readLine()).contains("UTC"));
|
||||
System.out.println(line.substring(4));
|
||||
}catch(IOException e){
|
||||
System.err.println("error connecting to server.");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue