// NewDateGMT returns a new Date object with the provided date and time in the
// GMT timezone
17418
func NewDateGMT(year int, month time.Month, day, hour, min, sec, nsec int) *Date {
	return &Date{Time: time.Date(year, month, day, hour, min, sec, nsec, gmt)}
}
672432
func newMsgEventer(rw MsgReadWriter, feed *event.Feed, peerID enode.ID, proto string) *msgEventer {
	return &msgEventer{
		MsgReadWriter: rw,
		feed:          feed,
		peerID:        peerID,
		Protocol:      proto,
	}
}
366067
func (s *AwsSecurityFindingFilters) SetUpdatedAt(v []*DateFilter) *AwsSecurityFindingFilters {
	s.UpdatedAt = v
	return s
}
695632
func parseTime(c *Cell) (string, error) {
	f, err := strconv.ParseFloat(c.Value, 64)
	if err != nil {
		return c.Value, err
	}
	val := TimeFromExcelTime(f, c.date1904)
	format := c.GetNumberFormat()
	// Replace Excel placeholders with Go time placeholders.
	// For example, replace yyyy with 2006. These are in a specific order,
	// due to the fact that m is used in month, minute, and am/pm. It would
	// be easier to fix that with regular expressions, but if it's possible
	// to keep this simple it would be easier to maintain.
	replacements := []struct{ xltime, gotime string }{
		{"yyyy", "2006"},
		{"yy", "06"},
		{"dd", "02"},
		{"d", "2"},
		{"mmm", "Jan"},
		{"mmss", "0405"},
		{"ss", "05"},
		{"hh", "15"},
		{"h", "3"},
		{"mm:", "04:"},
		{":mm", ":04"},
		{"mm", "01"},
		{"am/pm", "pm"},
		{"m/", "1/"},
		{".0", ".9999"},
	}
	for _, repl := range replacements {
		format = strings.Replace(format, repl.xltime, repl.gotime, 1)
	}
	// If the hour is optional, strip it out, along with the
	// possible dangling colon that would remain.
	if val.Hour() < 1 {
		format = strings.Replace(format, "]:", "]", 1)
		format = strings.Replace(format, "[3]", "", 1)
		format = strings.Replace(format, "[15]", "", 1)
	} else {
		format = strings.Replace(format, "[3]", "3", 1)
		format = strings.Replace(format, "[15]", "15", 1)
	}
	return val.Format(format), nil
}
22381
func (d *DateConverter) findDateMath(node expr.Node) {

	switch n := node.(type) {
	case *expr.BinaryNode:

		for i, arg := range n.Args {
			switch narg := arg.(type) {
			case *expr.StringNode:
				val := strings.ToLower(narg.Text)
				if strings.HasPrefix(val, `now`) {

					d.TimeStrings = append(d.TimeStrings, val)

					// If left side is datemath   "now-3d" < ident then re-write to have ident on left
					var lhv value.Value
					op := n.Operator.T
					var ok bool
					if i == 0 {
						lhv, ok = Eval(d.ctx, n.Args[1])
						if !ok {
							continue
						}
						// Reverse equation to put identity on left side
						// "now-1d" < last_visit    =>   "last_visit" > "now-1d"
						switch n.Operator.T {
						case lex.TokenGT:
							op = lex.TokenLT
						case lex.TokenGE:
							op = lex.TokenLE
						case lex.TokenLT:
							op = lex.TokenGT
						case lex.TokenLE:
							op = lex.TokenGE
						default:
							// lex.TokenEqual, lex.TokenEqualEqual, lex.TokenNE:
							// none of these are supported operators for finding boundary
							continue
						}
					} else if i == 1 {
						lhv, ok = Eval(d.ctx, n.Args[0])
						if !ok {
							continue
						}
					}

					d.addValue(lhv, op, val)
					continue
				}
			default:
				d.findDateMath(arg)
			}
		}

	case *expr.BooleanNode:
		for _, arg := range n.Args {
			d.findDateMath(arg)
		}
	case *expr.UnaryNode:
		d.findDateMath(n.Arg)
	case *expr.TriNode:
		for _, arg := range n.Args {
			d.findDateMath(arg)
		}
	case *expr.FuncNode:
		for _, arg := range n.Args {
			d.findDateMath(arg)
		}
	case *expr.ArrayNode:
		for _, arg := range n.Args {
			d.findDateMath(arg)
		}
	case *expr.IncludeNode:
		if err := resolveInclude(d.ctx, n, 0); err != nil {
			d.err = err
			return
		}
		if n.ExprNode != nil {
			d.findDateMath(n.ExprNode)
		}
	case *expr.NumberNode, *expr.ValueNode, *expr.IdentityNode, *expr.StringNode:
		// Scalar/Literal values cannot be datemath, must be binary-expression
	}
}
63123
func NewDateRangeQuery(start, end time.Time) *query.DateRangeQuery {
	return query.NewDateRangeQuery(start, end)
}
853405
func NewDateTimeFieldMapping() *FieldMapping {
	return &FieldMapping{
		Type:         "datetime",
		Store:        true,
		Index:        true,
		IncludeInAll: true,
		DocValues:    true,
	}
}
755444
func NewRegexpMap() *RegexpMap {
	return &RegexpMap{
		lookupValues:  make(map[string]*RegexpList),
		rules:         make(map[string]*regexp.Regexp),
		rulesRelation: make(map[string]refCount),
	}
}
406105
func (t Term) InsertAt(args ...interface{}) Term {
	return constructMethodTerm(t, "InsertAt", p.Term_INSERT_AT, args, map[string]interface{}{})
}
103147
func (tr Row) Date(nn int) (val Date) {
	val, err := tr.DateErr(nn)
	if err != nil {
		panic(err)
	}
	return
}
112425
func NewPGPDecrypt(g *libkb.GlobalContext, arg *PGPDecryptArg) *PGPDecrypt {
	return &PGPDecrypt{
		arg:          arg,
		Contextified: libkb.NewContextified(g),
	}
}
767894
func NewDateRangeQuery(start, end time.Time) *DateRangeQuery {
	return NewDateRangeInclusiveQuery(start, end, nil, nil)
}
1036971
func (this *FcmClient) NewFcmMsgTo(to string, body interface{}) *FcmClient {
	this.Message.To = to
	this.Message.Data = body

	return this
}
875615
func (s *RenewalSummary) SetUpdatedAt(v time.Time) *RenewalSummary {
	s.UpdatedAt = &v
	return s
}
722587
func Time() gopter.Gen {
	return func(genParams *gopter.GenParameters) *gopter.GenResult {
		sec := genParams.Rng.Int63n(253402214400) // Ensure year in [0, 9999]
		usec := genParams.Rng.Int63n(1000000000)

		return gopter.NewGenResult(time.Unix(sec, usec), TimeShrinker)
	}
}
465949
func NewUnixTimeFromSeconds(seconds float64) UnixTime {
	return NewUnixTimeFromDuration(time.Duration(seconds * float64(time.Second)))
}
27814
func NewMsgAlert(serializedPayload []byte, signature []byte) *MsgAlert {
	return &MsgAlert{
		SerializedPayload: serializedPayload,
		Signature:         signature,
		Payload:           nil,
	}
}