code: func (l *StringLiteral) ToTimeLiteral(loc *time.Location) (*TimeLiteral, error) {
  	if loc == nil {
  		loc = time.UTC
  	}
  
  	if isDateTimeString(l.Val) {
  		t, err := time.ParseInLocation(DateTimeFormat, l.Val, loc)
  		if err != nil {
  			// try to parse it as an RFCNano time
  			t, err = time.ParseInLocation(time.RFC3339Nano, l.Val, loc)
  			if err != nil {
  				return nil, ErrInvalidTime
  			}
  		}
  		return &TimeLiteral{Val: t}, nil
  	} else if isDateString(l.Val) {
  		t, err := time.ParseInLocation(DateFormat, l.Val, loc)
  		if err != nil {
  			return nil, ErrInvalidTime
  		}
  		return &TimeLiteral{Val: t}, nil
  	}
  	return nil, ErrInvalidTime
  }
docs: // ToTimeLiteral returns a time literal if this string can be converted to a time literal.