Skip to content
Vurdalakov edited this page Nov 24, 2017 · 1 revision
Overview

ntp command-line tool is a simple NTP client that gets network time from an NTP server.

Syntax
ntp [-utc] [-server:ntp.something.com] [-format:yyyy.MM.dd HH:mm:ss.fff]
Options

-utc or -u shows UTC time instead of local time.

-server or -s uses server other than pool.ntp.org.

-format or -f uses custom time format instead of yyyy MM dd HH mm ss fff. You can use any of standard and custom time formats.

-silent shows no error messages; please check exit code.

Examples
ntp
2017 11 24 07 42 06 231

ntp -u
2017 11 24 05 42 06 231

ntp -f:HH:mm:ss.fff
07:42:06.231

ntp -u -f:s
2017-11-24T05:42:06

ntp -s:time.windows.com
2017 11 24 07 42 06 231

Clone this wiki locally