i need to change the timestamps in a bind logfile because half of them are incorrect now that i have updated the system time...
every line in the file follows this format:
04-Aug-2010 07:32:31.416 client 10.0.0.1#00000: query: google.com IN A + (10.0.0.1)
all the time stamps are out by 8 hours. this is what i have so far:
#!/usr/bin/python
from time import strftime, strptime
f = open("query.log","r")
d = f.readlines()
i = 0
while not d[i].startswith("20-Aug"):
print strftime('%d-%b-%Y %H:%M:%S', strptime(d[i].split(".")[0], '%d-%b-%Y %H:%M:%S'))
i+=1
any ideas would be appreciated!!