def get_access_datetime(filepath):
    """
    Get the last time filepath was accessed.

    Parameters
    ----------
    filepath : str

    Returns
    -------
    access_datetime : datetime.datetime
    """
    import tzlocal
    tz = tzlocal.get_localzone()
    mtime = datetime.fromtimestamp(os.path.getatime(filepath))
    return mtime.replace(tzinfo=tz)
def get_access_datetime ( filepath ) : import tzlocal tz = tzlocal . get_localzone ( ) mtime = datetime . fromtimestamp ( os . path . getatime ( filepath ) ) return mtime . replace ( tzinfo = tz )
Get the last time filepath was accessed.

    Parameters
    ----------
    filepath : str

    Returns
    -------
    access_datetime : datetime.datetime