# Path: kquant_data/wind/utils.py
# def asDateTime(v, asDate=False):
#     """
#     万得中读出来的时间总多5ms，覆写这部分
#     w.asDateTime = asDateTime
#     w.start()
#     :param v:
#     :param asDate:
#     :return:
#     """
#     # return datetime(1899, 12, 30, 0, 0, 0, 0) + timedelta(v + 0.005 / 3600 / 24)
#     return datetime(1899, 12, 30, 0, 0, 0, 0) + timedelta(v)
# 
# Path: kquant_data/utils/xdatetime.py
# def datetime_2_yyyy(dt):
#     """
#     将时间转换成float类型
#     :param dt:
#     :return:
#     """
#     t = dt.timetuple()
#     return t.tm_year
# 
# Path: kquant_data/utils/xdatetime.py
# def datetime_2_yyyyMMdd(dt):
#     """
#     将时间转换成float类型
#     :param dt:
#     :return:
#     """
#     t = dt.timetuple()
#     return int((t.tm_year * 10000.0 + t.tm_mon * 100 + t.tm_mday))


from WindPy import w
from .utils import asDateTime
from ..utils.xdatetime import datetime_2_yyyy
from ..utils.xdatetime import datetime_2_yyyyMMdd
import os
import pandas as pd
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
调用wss函数的部分
"""



def download_fellow_listeddate(w, wind_codes, year):
    """
    增发上市日
    本想通过它来确认股本，但实际发现还是有一些差别，可能需要补充多下一些数据
    :param w:
    :param wind_codes:
    :param year:
    :return:
    """

# Path: kquant_data/wind/utils.py
# def asDateTime(v, asDate=False):
#     """
#     万得中读出来的时间总多5ms，覆写这部分
#     w.asDateTime = asDateTime
#     w.start()
#     :param v:
#     :param asDate:
#     :return:
#     """
#     # return datetime(1899, 12, 30, 0, 0, 0, 0) + timedelta(v + 0.005 / 3600 / 24)
#     return datetime(1899, 12, 30, 0, 0, 0, 0) + timedelta(v)
# 
# Path: kquant_data/utils/xdatetime.py
# def datetime_2_yyyy(dt):
#     """
#     将时间转换成float类型
#     :param dt:
#     :return:
#     """
#     t = dt.timetuple()
#     return t.tm_year
# 
# Path: kquant_data/utils/xdatetime.py
# def datetime_2_yyyyMMdd(dt):
#     """
#     将时间转换成float类型
#     :param dt:
#     :return:
#     """
#     t = dt.timetuple()
#     return int((t.tm_year * 10000.0 + t.tm_mon * 100 + t.tm_mday))


# Path: kquant_data/wind/wss.py
from WindPy import w
from .utils import asDateTime
from ..utils.xdatetime import datetime_2_yyyy
from ..utils.xdatetime import datetime_2_yyyyMMdd
import os
import pandas as pd

#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
调用wss函数的部分
"""



def download_fellow_listeddate(w, wind_codes, year):
    """
    增发上市日
    本想通过它来确认股本，但实际发现还是有一些差别，可能需要补充多下一些数据
    :param w:
    :param wind_codes:
    :param year:
    :return:
    """

    w.asDateTime = asDateTime