This shell script connects to nist.time.gov NTP server and updates your system time accordingly.
#!/bin/bash
#
# @(#)ntp.sh 1.0 07/06/04
#
# Copyright (c) 2004
# Ali Onur Cinar &060;cinar(a)zdo.com&062;
#
# License:
#
# Permission to use, copy, modify, and distribute this software and its
# documentation without fee is hereby granted, provided that the above
# copyright notice appear in all copies and that both the copyright
# notice and this permission notice and warranty disclaimer appear in
# supporting documentation, and that the name of Ali Onur Cinar not be
# used in advertising or publicity pertaining to distribution of the
# software without specific, written prior permission.
#
ntpHost=time.nist.gov
ntpPort=13
ntpTemp=/tmp/ntp.$$
telnet ${ntpHost} ${ntpPort} 2> /dev/null \
| tail -1 \
| sed -e 's/-/ /g ; s/:/ /g' \
> ${ntpTemp}
while read -a n
do
date --utc ${n[2]}${n[3]}${n[4]}${n[5]}${n[1]}.${n[6]}
done < ${ntpTemp}
rm -f ${ntpTemp}