from datetime import datetime


def ticks_from_datetime(dt: datetime):
    """Convert datetime to .Net ticks"""
    if type(dt) is not datetime:
        raise TypeError('dt must be a datetime object')
    return (dt - datetime(1, 1, 1)).total_seconds() * 10000000