import time


def _parse_spectre_timetag (hist_line,sec=0):
    """ parse the SPECTRE time tag 
    
    Parameters
    ----------
    hist_line : string
        "HISTORY 23: 7:2008 D1,2,3: 5.50348825884E+03 4.46070136915E-02 0.00000000000E+00"
    
    Returns
    -------
    time : float
        the date 7/23/2008 + sec in seconds      
    """
    date_str = hist_line[:10]
    day,month,year = [int(s) for s in date_str.split(":")]
    timetag = time.mktime((year,month,day,0,0,sec,0,0,0))
    return timetag