I want to get the current date and time according to a remote NTP server, using Linux. I don't want to change the local time as a result; I just want to get the remote date, adjusted for the local time zone, printed out. The date returned must comply with the following criteria:
- It needs to be reasonably accurate.
- It needs to be adjusted for the timezone on the local system making the request.
- It needs to be formatted in an easily-readable or interpretable way (standard date format, or seconds since epoch).
What I've Tried:
I can call
ntpdate -q my.ntp.server and get the offset between the local time and the server's time, but that doesn't return the date according to the NTP server; it just returns the offset and the local date.
Is there some easy way/command I can use to say: "Print out the date according to a given NTP server, adjusted for my current timezone"?