def parse_date (data, unmask=False, strict=False, minute_specific=False): """ Some dates are formatted/stored down to the second (Sensor CalBGForPH) while others are stored down to the minute (CGM SensorTimestamp dates). """ data = data[:] seconds = 0 minutes = 0 hours = 0 year = times.parse_years(data[0]) day = parse_day(data[1]) minutes = parse_minutes(data[2]) hours = parse_hours(data[3]) month = parse_months(data[3], data[2]) try: date = datetime(year, month, day, hours, minutes, seconds) return date except ValueError, e: if strict: raise if unmask: return (year, month, day, hours, minutes, seconds) pass
def parse_date (data): """ """ data = data[:] seconds = 0 minutes = 0 hours = 0 year = times.parse_years(data[0]) day = parse_day(data[1]) minutes = parse_minutes(data[2]) hours = parse_hours(data[3]) month = parse_months(data[3]) try: date = datetime(year, month, day, hours, minutes, seconds) return date except ValueError, e: pass