#! /usr/bin/env python

import sys
import csv
import os.path
import datetime

with open(sys.argv[1]) as infile:
    infile = csv.DictReader(infile)
    with open(sys.argv[2], "w") as outfile:
        outfile = csv.DictWriter(outfile, infile.fieldnames, 'ignore')
        outfile.writeheader()
        for row in infile:
            row['timestamp'] = datetime.datetime.strptime(row['timestamp'], "%Y-%m-%d %H:%M:%S UTC").strftime("%s")
            outfile.writerow(row)

