New hack. v2.15.18
authorCarl Hetherington <cth@carlh.net>
Sun, 8 Sep 2019 00:49:52 +0000 (01:49 +0100)
committerCarl Hetherington <cth@carlh.net>
Sun, 8 Sep 2019 00:49:52 +0000 (01:49 +0100)
hacks/dcp_time_to_tc [new file with mode: 0755]

diff --git a/hacks/dcp_time_to_tc b/hacks/dcp_time_to_tc
new file mode 100755 (executable)
index 0000000..bfb3966
--- /dev/null
@@ -0,0 +1,15 @@
+#!/usr/bin/python3
+
+import sys
+
+TICKS = 96000
+
+in_time = int(sys.stdin.readline())
+h = in_time // (TICKS * 60 * 60)
+in_time -= h * (TICKS * 60 * 60)
+m = in_time // (TICKS * 60)
+in_time -= m * (TICKS * 60)
+s = in_time // TICKS
+in_time -= s * TICKS
+
+print('%02d:%02d:%02d' % (h, m, s))