2
0
mirror of https://github.com/status-im/consul.git synced 2025-02-28 05:10:40 +00:00

19 lines
393 B
Go
Raw Normal View History

// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
//go:build darwin || freebsd || netbsd || openbsd
package logging
import (
"os"
"syscall"
"time"
)
func (l *LogFile) createTime(stat os.FileInfo) time.Time {
stat_t := stat.Sys().(*syscall.Stat_t)
createTime := stat_t.Ctimespec
return time.Unix(int64(createTime.Sec), int64(createTime.Nsec)) //nolint:unconvert
}