A pure Python implementation of pandas.date_range().
        Given 2 of start, end, periods and freq, generate a series of 
        datetime object.
        
        :param start: Left bound for generating dates
        :type start: str or datetime.datetime (default None)
        
        :param end: Right bound for generating dates
        :type end: str or datetime.datetime (default None)
                
        :param periods: Number of date points. If None, must specify start 
            and end
        :type periods: integer (default None)
                
        :param freq: string, default '1day' (calendar daily)
            Available mode are day, hour, min, sec
            Frequency strings can have multiples. e.g.
                '7day', '6hour', '5min', '4sec'
        :type freq: string (default '1day' calendar daily)

        :param normalize: Trigger that normalize start/end dates to midnight
        :type normalize: boolean (default False)
        
        :return: A list of datetime.datetime object. An evenly sampled time
            series.
            
        Usage::
            
            >>> from __future__ print_function
            >>> from weatherlab.lib.timelib.timewrapper import timewrapper
            >>> for dt in timewrapper.dtime_range("2014-1-1", "2014-1-7"):
            ...     print(dt)
            2014-01-01 00:00:00
            2014-01-02 00:00:00
            2014-01-03 00:00:00
            2014-01-04 00:00:00
            2014-01-05 00:00:00
            2014-01-06 00:00:00
            2014-01-07 00:00:00
            
        **中文文档**
        
        生成等间隔的时间序列。
        
        需要给出, "起始", "结束", "数量"中的任意两个。以及指定"频率"。以此唯一
        确定一个等间隔时间序列。"频率"项所支持的命令字符有"7day", "6hour", 
        "5min", "4sec" (可以改变数字).

def dtime_range(self, start=None, end=None, periods=None, 
                    freq="1day", normalize=False, return_date=False):
        """A pure Python implementation of pandas.date_range().
        Given 2 of start, end, periods and freq, generate a series of 
        datetime object.
        
        :param start: Left bound for generating dates
        :type start: str or datetime.datetime (default None)
        
        :param end: Right bound for generating dates
        :type end: str or datetime.datetime (default None)
                
        :param periods: Number of date points. If None, must specify start 
            and end
        :type periods: integer (default None)
                
        :param freq: string, default '1day' (calendar daily)
            Available mode are day, hour, min, sec
            Frequency strings can have multiples. e.g.
                '7day', '6hour', '5min', '4sec'
        :type freq: string (default '1day' calendar daily)

        :param normalize: Trigger that normalize start/end dates to midnight
        :type normalize: boolean (default False)
        
        :return: A list of datetime.datetime object. An evenly sampled time
            series.
            
        Usage::
            
            >>> from __future__ print_function
            >>> from weatherlab.lib.timelib.timewrapper import timewrapper
            >>> for dt in timewrapper.dtime_range("2014-1-1", "2014-1-7"):
            ...     print(dt)
            2014-01-01 00:00:00
            2014-01-02 00:00:00
            2014-01-03 00:00:00
            2014-01-04 00:00:00
            2014-01-05 00:00:00
            2014-01-06 00:00:00
            2014-01-07 00:00:00
            
        **中文文档**
        
        生成等间隔的时间序列。
        
        需要给出, "起始", "结束", "数量"中的任意两个。以及指定"频率"。以此唯一
        确定一个等间隔时间序列。"频率"项所支持的命令字符有"7day", "6hour", 
        "5min", "4sec" (可以改变数字).
        """
        def normalize_datetime_to_midnight(dtime):
            """normalize a datetime %Y-%m-%d %H:%M:%S to %Y-%m-%d 00:00:00
            """
            return datetime(dtime.year, dtime.month, dtime.day)
        
        def not_normalize(dtime):
            """do not normalize
            """
            return dtime
        
        time_series = list()
        
        # if two of start, end, or periods exist
        if (bool(start) + bool(end) + bool(periods)) == 2:
            if normalize:
                converter = normalize_datetime_to_midnight
            else:
                converter = not_normalize
            
            interval = self._freq_parser(freq)
            
            if (bool(start) & bool(end)): # start and end
                start = self.parse_datetime(start)
                end = self.parse_datetime(end)
                
                if start > end: # if start time later than end time, raise error
                    raise Exception("start time has to be eariler and equal "
                                    "than end time")
                    
                start = start - interval
                
                while 1:
                    start += interval
                    if start <= end:
                        time_series.append( converter(start) )
                    else:
                        break
                    
            elif (bool(start) & bool(periods)): # start and periods
                start = self.parse_datetime(start)
                
                start = start - interval
                for _ in range(periods):
                    start += interval
                    time_series.append( converter(start) )
                    
            elif (bool(end) & bool(periods)): # end and periods
                end = self.parse_datetime(end)
                
                start = end - interval * periods
                for _ in range(periods):
                    start += interval
                    time_series.append( converter(start) )

        else:
            raise Exception("Must specify two of start, end, or periods")
        
        if return_date:
            time_series = [i.date() for i in time_series]
            
        return time_series