import calendar
import time


def iso2ts(date):
  """Convert ISO 8601 date to timestamp, i.e. seconds since epoch."""
  if date is None: return 0
  return calendar.timegm(time.strptime(date, "%Y-%m-%dT%H:%M:%SZ"))