django_any/xunit.py
def any_datetime(from_date=datetime(1990, 1, 1), to_date=datetime.now()):
    """
    Return random datetime from the [from_date, to_date] interval

    >>> result = any_datetime(from_date=datetime(1990,1,1), to_date=datetime(1990,1,3))
    >>> type(result)
    <type 'datetime.datetime'>
    >>> result >= datetime(1990,1,1) and result <= datetime(1990,1,3)
    True
    """
    days = any_int(min_value=0, max_value=(to_date - from_date).days-1)
    time = timedelta(seconds=any_int(min_value=0, max_value=24*3600-1))

    return from_date + timedelta(days=days) + time
def any_datetime(from_date=datetime(1990, 1, 1), to_date=datetime.now()):
    """
    Return random datetime from the [from_date, to_date] interval

    >>> result = any_datetime(from_date=datetime(1990,1,1), to_date=datetime(1990,1,3))
    >>> type(result)
    <type 'datetime.datetime'>
    >>> result >= datetime(1990,1,1) and result <= datetime(1990,1,3)
    True
    """
    days = any_int(min_value=0, max_value=(to_date - from_date).days-1)
    time = timedelta(seconds=any_int(min_value=0, max_value=24*3600-1))

    return from_date + timedelta(days=days) + time
def any_datetime ( from_date = datetime ( 1990 , 1 , 1 ) , to_date = datetime . now ( ) ) : days = any_int ( min_value = 0 , max_value = ( to_date - from_date ) . days - 1 ) time = timedelta ( seconds = any_int ( min_value = 0 , max_value = 24 * 3600 - 1 ) ) return from_date + timedelta ( days = days ) + time
Return random datetime from the [from_date, to_date] interval

    >>> result = any_datetime(from_date=datetime(1990,1,1), to_date=datetime(1990,1,3))
    >>> type(result)
    <type 'datetime.datetime'>
    >>> result >= datetime(1990,1,1) and result <= datetime(1990,1,3)
    True
Return random datetime from the [ from_date to_date ] interval >>> result = any_datetime ( from_date = datetime ( 1990 1 1 ) to_date = datetime ( 1990 1 3 )) >>> type ( result ) <type datetime . datetime > >>> result > = datetime ( 1990 1 1 ) and result < = datetime ( 1990 1 3 ) True