# 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)


from ..processing.utils import *
from .utils import asDateTime
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
调用wset函数的部分

单位累计分红可以间接拿到分红日期
w.wsd("510050.SH", "div_accumulatedperunit", "2016-01-25", "2017-02-23", "")

"""


def download_daily_at(
        w,
        codes,
        fields,
        date,
        option="Fill=Previous;PriceAdj=F"):
    """
    下载具体某一天的数据，这种数据一般不是很多
    :param codes:
    :param fields:
    :param beginTime:
    :param endTime:
    :param columns:
    :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/wind/wsd.py
from ..processing.utils import *
from .utils import asDateTime

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

单位累计分红可以间接拿到分红日期
w.wsd("510050.SH", "div_accumulatedperunit", "2016-01-25", "2017-02-23", "")

"""


def download_daily_at(
        w,
        codes,
        fields,
        date,
        option="Fill=Previous;PriceAdj=F"):
    """
    下载具体某一天的数据，这种数据一般不是很多
    :param codes:
    :param fields:
    :param beginTime:
    :param endTime:
    :param columns:
    :return:
    """

    w.asDateTime = asDateTime