-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAtomicTime.java
More file actions
29 lines (27 loc) · 811 Bytes
/
AtomicTime.java
File metadata and controls
29 lines (27 loc) · 811 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
Author: Rees de la Houssaye
Date: 7/25/18
Description: Simple program that uses the Jsoup library to get the Internation Atomic Time off the web.
*/
import java.io.*;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
public class JavaApplication3
{
public static void main(String[] args)
{
try
{
Document doc = Jsoup.connect("https://www.timeanddate.com/time/international-atomic-time.html").get();
Element temp = doc.select("span.ctm-hrmn").first();
Element temp2 = doc.select("span.ctm-sec").first();
System.out.println(temp.text() + ":" + temp2.text());
}
catch(IOException e)
{
e.printStackTrace();
}
}
}