import pytz


def dt_naive_to_dt_aware(datetime_naive,local_timezone):
    """
    Convert a naive dt object (no tzinfo attached) to an aware dt object.
    
    Parameters
    ----------
    datetime_naive : datetime.datetime
        naive datetime object -- e.g. dt.datetime(2021, 4, 15, 23, 59, 59)
    local_timezone : pytz.timezone, or str
        pytz.timezone object, or string of a standard Olson database 
        timezone name (e.g. 'US/Pacific')
    
    Example
    ------- 
    obs.dt_naive_to_dt_aware(dt.datetime.strptime('2021/04/15 23:59:59','%Y/%m/%d %H:%M:%S'),'US/Pacific')
    """
    if type(local_timezone) is str: local_timezone=pytz.timezone(local_timezone)
    #datetime_aware=dt.datetime(datetime_naive.year, datetime_naive.month, datetime_naive.day, datetime_naive.hour, datetime_naive.minute, datetime_naive.second, datetime_naive.microsecond,local_timezone)
    ##Here: just use .localize with the naive time.  localize applies the tzinfo to the naive time, including DST info.
    datetime_aware=local_timezone.localize(datetime_naive)
    return datetime_aware