// creating Timestamp struct from string array of counts [Y M D h m s]
161015
func CreateTimestamp(time_point []string) Timestamp {
	year, _ := strconv.Atoi(time_point[0])
	month, _ := strconv.Atoi(time_point[1])
	day, _ := strconv.Atoi(time_point[2])
	hour, _ := strconv.Atoi(time_point[3])
	min, _ := strconv.Atoi(time_point[4])
	sec, milliSec, microSec, nanoSec, picoSec := secondFragments(time_point[5])

	return Timestamp{
		Year:     year,
		Month:    month,
		Day:      day,
		Hour:     hour,
		Min:      min,
		Sec:      sec,
		MilliSec: milliSec,
		MicroSec: microSec,
		NanoSec:  nanoSec,
		PicoSec:  picoSec,
	}
}
543007
func GetISO8601TimeStamp(ts time.Time) string {
	t := ts.UTC()
	return fmt.Sprintf("%04d-%02d-%02dT%02d:%02d:%02dZ", t.Year(), t.Month(), t.Day(), t.Hour(), t.Minute(), t.Second())
}
700079
func readTimestamp(ts *timestamp.Timestamp) time.Time {
	t, err := ptypes.Timestamp(ts)
	if err != nil {
		return time.Time{}
	}
	return t
}
5064
func (h *VHDHeader) TimestampTime() time.Time {
	tstamp := binary.BigEndian.Uint32(h.Timestamp[:])
	return time.Unix(int64(946684800+tstamp), 0)
}
1203857
func TimestampFromSigned(s *Signed) (*SignedTimestamp, error) {
	ts := Timestamp{}
	if err := defaultSerializer.Unmarshal(*s.Signed, &ts); err != nil {
		return nil, err
	}
	if err := IsValidTimestampStructure(ts); err != nil {
		return nil, err
	}
	sigs := make([]Signature, len(s.Signatures))
	copy(sigs, s.Signatures)
	return &SignedTimestamp{
		Signatures: sigs,
		Signed:     ts,
	}, nil
}
72268
func (cmp *TimestampLessThan) MarshalJSON() ([]byte, error) {
	return json.Marshal(&struct {
		Variable          string
		TimestampLessThan string
	}{
		Variable:          cmp.Variable,
		TimestampLessThan: cmp.Value.Format(time.RFC3339),
	})
}
463249
func (t Timestamp) MarshalJSON() ([]byte, error) {
	if t.Location() != time.UTC {
		return nil, errors.New("Timestamp.MarshalJSON: time zone must be UTC")
	}
	if y := t.Year(); y < 0 || 9999 < y {
		// RFC 3339 is clear that years are 4 digits exactly.
		// See golang.org/issue/4556#issuecomment-66073163 for more discussion.
		return nil, errors.New("Timestamp.MarshalJSON: year outside of range [0,9999]")
	}
	b := make([]byte, 0, len(timeLayout)+2)
	b = append(b, '"')
	b = t.AppendFormat(b, timeLayout)
	b = append(b, '"')
	return b, nil
}
161885
func (i *Index) AddColumnTimestamp(field string, row, col uint64OrString, ts time.Time) {
	i.addColumn(field, row, col, ts.UnixNano())
}
758230
func (p *PushEventCommit) GetTimestamp() Timestamp {
	if p == nil || p.Timestamp == nil {
		return Timestamp{}
	}
	return *p.Timestamp
}
1111551
func (logTags) Timestamp(ts time.Time) LogTag {
	return func(lr *LogRecord) {
		lr.Timestamp = ts.UTC().Format(time.RFC3339Nano)
	}
}
881572
func (e *Encoder) marshalStruct(str interface{}, child bool) ([]string, bool) {
	var cols []string
	val := reflect.ValueOf(str)
	typ := reflect.TypeOf(str)
	for i := 0; i < typ.NumField(); i++ {
		tF := typ.Field(i)
		if len(tF.PkgPath) > 0 {
			continue
		}
		name := e.getFieldName(tF)
		if name == "" {
			continue
		}
		vF := val.Field(i)
		tmp, ok := e.marshal(vF, child)
		if !ok {
			// wasn't a supported kind, skip
			continue
		}
		cols = append(cols, tmp...)
	}
	return cols, true
}
944634
func (t Timestamp) Parse() (time.Time, error) {
	return time.Parse(time.RFC3339, string(t))
}
1097949
func getTimeStamp() string {
	now := time.Now().Format("2006.01.02.15.04.05.000")
	timeSlot := strings.Replace(now, ".", "", -1)
	return timeSlot
}
983697
func (b *UpdateBuilder) Timestamp(t time.Time) *UpdateBuilder {
	b.using.Timestamp(t)
	return b
}
1365966
func (c *ChannelsMarkCall) Timestamp(timestamp string) *ChannelsMarkCall {
	c.timestamp = timestamp
	return c
}
1358624
func TimeSinceNowAsString(t time.Time) string {
	return DurationToString(time.Now().Sub(t))
}
870126
func Timestamp(t time.Time) uint64 {
	return uint64(t.Unix())*1000 +
		uint64(t.Nanosecond()/int(time.Millisecond))
}