// getModTime - get the file modification time of `path`
327037
func getModTime(path string) (t time.Time, err *probe.Error) {
	var e error
	path, e = filepath.EvalSymlinks(path)
	if e != nil {
		return t, probe.NewError(fmt.Errorf("Unable to get absolute path of %s. %s", path, e))
	}

	// Version is mc non-standard, we will use mc binary's
	// ModTime as release time.
	var fi os.FileInfo
	fi, e = os.Stat(path)
	if e != nil {
		return t, probe.NewError(fmt.Errorf("Unable to get ModTime of %s. %s", path, e))
	}

	// Return the ModTime
	return fi.ModTime().UTC(), nil
}
766632
func (fi *linuxExFileInfo) ATime() time.Time {
	return timespecToTime(fi.Sys().(*syscall.Stat_t).Atim)
}
1078534
func (d DirentFileInfo) ModTime() time.Time {
	return time.Unix(int64(d.Entry.Time/1000), int64(d.Entry.Time%1000)*1000000)
}
388860
func (w *WebHookCommit) GetTimestamp() time.Time {
	if w == nil || w.Timestamp == nil {
		return time.Time{}
	}
	return *w.Timestamp
}
1198788
func (fi *winExFileInfo) CTime() time.Time {
	creationTime := fi.Sys().(syscall.Win32FileAttributeData).CreationTime
	n := creationTime.Nanoseconds()
	return time.Unix(0, n)
}
1297831
func (m Area) GetLastModified() time.Time {
	return m.UpdatedAt.Truncate(time.Second)
}
659793
func (r *Run) RequestedAtTime() (time.Time, error) {
	return time.Parse(time.RFC3339, r.RequestedAt)
}
957760
func GetTimeValue(ctx context.Context, v interface{}, tp byte, fsp int) (types.Datum, error) {
	return getTimeValue(ctx, v, tp, fsp)
}
319908
func GetLastModified() *File {
	lastModified.Lock()
	defer lastModified.Unlock()

	return &File{Content: lastModified.contents, Hash: lastModified.sha256}
}
398621
func (p *Process) GetUptime() time.Duration {
	if p.startTime.Nanosecond() == 0 {
		return 0
	}
	return time.Since(p.startTime)
}
729881
func (self *TimedRotatingFileHandler) getFilesToDelete() ([]string, error) {
	dirName, baseName := filepath.Split(self.GetFilePath())
	fileInfos, err := ioutil.ReadDir(dirName)
	if err != nil {
		return nil, err
	}
	prefix := baseName + "."
	pattern, err := regexp.Compile(self.extMatch)
	if err != nil {
		return nil, err
	}
	var fileNames []string
	for _, info := range fileInfos {
		fileName := info.Name()
		if strings.HasPrefix(fileName, prefix) {
			suffix := fileName[len(prefix):]
			if pattern.MatchString(suffix) {
				fileNames = append(fileNames, fileName)
			}
		}
	}
	// no need to sort fileNames since ioutil.ReadDir() returns sorted list.
	var result []string
	if uint32(len(fileNames)) < self.backupCount {
		return result, nil
	}
	result = fileNames[:uint32(len(fileNames))-self.backupCount]
	for i := 0; i < len(result); i++ {
		result[i] = filepath.Join(dirName, result[i])
	}
	return result, nil
}
245504
func (fr *FileReader) UnixMtime() time.Time {
	t, err := time.Parse(time.RFC3339, fr.ss.UnixMtime)
	if err != nil {
		return time.Time{}
	}
	return t
}
523535
func listObjectModtimes(partsMetadata []xlMetaV1, errs []error) (modTimes []time.Time) {
	modTimes = bootModtimes(len(partsMetadata))
	for index, metadata := range partsMetadata {
		if errs[index] != nil {
			continue
		}
		// Once the file is found, save the uuid saved on disk.
		modTimes[index] = metadata.Stat.ModTime
	}
	return modTimes
}
205591
func (h *FileHeader) ModTime() time.Time {
	return msDosTimeToTime(h.ModifiedDate, h.ModifiedTime)
}
1318695
func WriteFileFromReaderWithModTime(ctx context.Context, bs blobserver.StatReceiver, filename string, modTime time.Time, r io.Reader) (blob.Ref, error) {
	if strings.Contains(filename, "/") {
		return blob.Ref{}, fmt.Errorf("schema.WriteFileFromReader: filename %q shouldn't contain a slash", filename)
	}

	m := NewFileMap(filename)
	if !modTime.IsZero() {
		m.SetModTime(modTime)
	}
	return WriteFileMap(ctx, bs, m, r)
}
558042
func (d *Domain) GetTime(flags uint32) (int64, uint, error) {
	if C.LIBVIR_VERSION_NUMBER < 1002005 {
		return 0, 0, makeNotImplementedError("virDomainGetTime")
	}
	var secs C.longlong
	var nsecs C.uint
	var err C.virError
	ret := C.virDomainGetTimeWrapper(d.ptr, &secs, &nsecs, C.uint(flags), &err)
	if ret == -1 {
		return 0, 0, makeError(&err)
	}

	return int64(secs), uint(nsecs), nil
}
648434
func (t *TrafficData) GetTimestamp() Timestamp {
	if t == nil || t.Timestamp == nil {
		return Timestamp{}
	}
	return *t.Timestamp
}