Project

General

Profile

ClockDrifting » History » Revision 4

Revision 3 (sb1066 -, 2010-10-29 07:24) → Revision 4/6 (sb1066 -, 2010-10-29 07:24)

If your clock is getting out of sync the best thing would be to use an ntp server. But since that require a internet connection I wrote a small script that uses the time table transmitted by the DVB providers instead.

<pre>
{{{
#!/bin/bash

UTC=@/usr/bin/dvbsnoop UTC=`/usr/bin/dvbsnoop -N 1 0x14 | /bin/grep 'UTC_time' | /bin/cut -c27-45@ -c27-45`
date --utc --set="${UTC}"
</pre>

}}}

In order for this to work you need:

* a DVB card in your computer (obviously).

* "dvbsnoop":http://dvbsnoop.sourceforge.net/ [http://dvbsnoop.sourceforge.net/ dvbsnoop] installed.

* rights to change the clock

* to have your bios set to UTC time (and correct timezone in linux)