MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Getting the Date and Time From a Time Server

  • To: mathgroup at smc.vnet.net
  • Subject: [mg120906] Re: Getting the Date and Time From a Time Server
  • From: Sébastien Roy <roys3d at gmail.com>
  • Date: Sun, 14 Aug 2011 20:20:19 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <j25kro$ou6$1@smc.vnet.net>

Maybe you could run the "ntpdate" program external and retreive the
time offset between your computer clock and the time server.
(in the following example, the time server is only good in canada)

Run["ntpdate -q time.chu.nrc.ca >/tmp/toto"]
res=Import["/tmp/toto", "Table","FieldSeparators" -> {" ", ","}]
offset=res[[1,6]]   (* not very portable... :-( *)

Now you can use the internal Mathematica clock and add the offset to
get the correct time.

DateList[AbsoluteTime[]+offset]





  • Prev by Date: Re: Treat subscripted variables as symbols
  • Next by Date: Re: How to plot weighted edges on this graph?
  • Previous by thread: Re: Getting the Date and Time From a Time Server
  • Next by thread: Re: Getting the Date and Time From a Time Server