import time

def datetime_to_timestamp(obj):
    timestamp = time.mktime(obj.timetuple())
    return timestamp

def datetime_to_timestamp_millis(obj):
    timestamp = datetime_to_timestamp(obj)
    return timestamp*1000