# HG changeset patch # User Henry S. Thompson # Date 1709218790 0 # Node ID cfdba7ce9a1fdf6824ad7e224fa8ebf498bb9218 # Parent d58bc29a8ec9f75c8b96fe514943b3da50634e1c compute offset between LM and crawl timestamp diff -r d58bc29a8ec9 -r cfdba7ce9a1f lib/python/cc/lmh/compare.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/python/cc/lmh/compare.py Thu Feb 29 14:59:50 2024 +0000 @@ -0,0 +1,14 @@ +#!/usr/bin/python3 +'''Compute difference in seconds between crawl time and Last-Modified time''' +import sys +from datetime import datetime, timezone + +UTC=timezone.utc + +for l in sys.stdin: + cctime, lm = l.split() + cc = datetime(int(cctime[0:4]),int(cctime[4:6]),int(cctime[6:8]), + int(cctime[8:10]),int(cctime[10:12]),int(cctime[12:14]),tzinfo=UTC) + print(cctime,lm,float(lm)-cc.timestamp()) + +