import time


def gmtime_for_datetime(dt):
    """
    Pass in a datetime object, and get back time.gmtime
    """
    return time.gmtime(time.mktime(time.strptime(dt.strftime("%Y-%m-%d %H:%M:%S"), "%Y-%m-%d %H:%M:%S"))) if dt is not None else None