daytime <- function(host = "localhost"){
a <- make.socket(host, 13)
on.exit(close.socket(a))
read.socket(a)
}
## Official time (UTC) from US Naval Observatory
daytime("tick.usno.navy.mil")
Run the code above in your browser using DataLab