// GetISO8601TimeStamp gets timestamp string in ISO8601 format
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())
}
722607
func ConvertToTimestamp(timeString string) *Timestamp {
	parsed, _ := time.Parse(time.RFC3339Nano, timeString)
	return &Timestamp{parsed}
}
1154002
func (s *GetShardIteratorInput) SetTimestamp(v time.Time) *GetShardIteratorInput {
	s.Timestamp = &v
	return s
}
700917
func GetTimestampField(r *http.Request, fieldName string) (time.Time, error) {
	if _, ok := r.Form[fieldName]; !ok {
		return time.Now(), MissingFieldError{fieldName}
	}
	parsedTime, err := time.Parse(time.RFC1123, r.FormValue(fieldName))
	if err != nil {
		// Attempt to parse with offset timezone before giving up
		parsedTime, err = time.Parse(time.RFC1123Z, r.FormValue(fieldName))
		if err != nil {
			log.Infof("Failed to convert timestamp %v: %v", r.FormValue(fieldName), err)
			return time.Now(), InvalidFormatError{fieldName, r.FormValue(fieldName)}
		}
	}
	return parsedTime, nil
}
339179
func (o *pdOracle) GetTimestamp(ctx context.Context) (uint64, error) {
	ts, err := o.getTimestamp(ctx)
	if err != nil {
		return 0, errors.Trace(err)
	}
	o.setLastTS(ts)
	return ts, nil
}
1284547
func (c chatResponseFull) getMessageTimestamp() string {
	if len(c.Timestamp) > 0 {
		return c.Timestamp
	}
	return c.MessageTimeStamp
}
857031
func (s *MetricDatapoint) SetTimestamp(v time.Time) *MetricDatapoint {
	s.Timestamp = &v
	return s
}
525164
func printTimestamp(v uint32) *bytes.Buffer {
	if v == 0 {
		return bytes.NewBuffer(ZeroTimestamp)
	}

	t := time.Unix(int64(v), 0).UTC()
	year, month, day := t.Date()
	hour, minute, second := t.Clock()

	result := &bytes.Buffer{}
	fmt.Fprintf(result, "%04d-%02d-%02d %02d:%02d:%02d", year, int(month), day, hour, minute, second)
	return result
}
1212291
func (st *State) ControllerTimestamp() (*time.Time, error) {
	now := st.clock().Now()
	return &now, nil
}
1348423
func decodeTimestamp(rd *bufio.Reader) (string, Timestamp, error) {
	// name
	name, err := readCstring(rd)
	if err != nil {
		return "", 0, err
	}

	// value
	i64, err := readInt64(rd)
	if err != nil {
		return "", 0, err
	}
	return name, Timestamp(i64), nil
}
122840
func ParseTimestamp(sc *stmtctx.StatementContext, str string) (Time, error) {
	return ParseTime(sc, str, mysql.TypeTimestamp, GetFsp(str))
}
1149581
func (o *MockOracle) GetTimestamp(context.Context) (uint64, error) {
	o.Lock()
	defer o.Unlock()

	if o.stop {
		return 0, errors.Trace(errStopped)
	}
	physical := oracle.GetPhysical(time.Now().Add(o.offset))
	ts := oracle.ComposeTS(physical, 0)
	if oracle.ExtractPhysical(o.lastTS) == physical {
		ts = o.lastTS + 1
	}
	o.lastTS = ts
	return ts, nil
}
678072
func (s *TerminationHealth) SetTimestamp(v time.Time) *TerminationHealth {
	s.Timestamp = &v
	return s
}
1046380
func (s *Event) SetTimestamp(v string) *Event {
	s.Timestamp = &v
	return s
}
876037
func (r *runtimeCache) getPodsWithTimestamp() ([]*Pod, time.Time, error) {
	// Always record the timestamp before getting the pods to avoid stale pods.
	timestamp := time.Now()
	pods, err := r.getter.GetPods(false)
	return pods, timestamp, err
}
363670
func (pt *ParseTime) ISO8601(value string) (time.Time, error) {
	t, _, err := parseISO8601(value, pt.location)
	return t, err
}
526098
func (s *FileSystemSize) SetTimestamp(v time.Time) *FileSystemSize {
	s.Timestamp = &v
	return s
}