mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-20 01:34:24 +08:00
modify method name
This commit is contained in:
@@ -27,7 +27,7 @@ func (f *LogFormatter) Format(entry *logrus.Entry) ([]byte, error) {
|
|||||||
b = &bytes.Buffer{}
|
b = &bytes.Buffer{}
|
||||||
}
|
}
|
||||||
|
|
||||||
b.WriteString(utils.FormatToLongDateTime(time.Now()))
|
b.WriteString(utils.FormatUnixTimeToLongDateTimeInServerTimezone(time.Now().Unix()))
|
||||||
b.WriteString(" ")
|
b.WriteString(" ")
|
||||||
|
|
||||||
if f.Prefix != "" {
|
if f.Prefix != "" {
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ const (
|
|||||||
longDateTimeWithoutSecondFormat = "2006-01-02 15:04"
|
longDateTimeWithoutSecondFormat = "2006-01-02 15:04"
|
||||||
)
|
)
|
||||||
|
|
||||||
// FormatToLongDateTime returns a textual representation of the time value formatted by long date time format
|
// FormatUnixTimeToLongDateTimeInServerTimezone returns a textual representation of the unix time formatted by long date time format
|
||||||
func FormatToLongDateTime(t time.Time) string {
|
func FormatUnixTimeToLongDateTimeInServerTimezone(unixTime int64) string {
|
||||||
return t.Format(longDateTimeFormat)
|
return ParseFromUnixTime(unixTime).Format(longDateTimeFormat)
|
||||||
}
|
}
|
||||||
|
|
||||||
// FormatToLongDateTimeWithoutSecond returns a textual representation of the time value formatted by long date time format (no second)
|
// FormatToLongDateTimeWithoutSecond returns a textual representation of the time value formatted by long date time format (no second)
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ func GetFullVersion() string {
|
|||||||
unixTime, err := utils.StringToInt64(BuildUnixTime)
|
unixTime, err := utils.StringToInt64(BuildUnixTime)
|
||||||
|
|
||||||
if unixTime > 0 && err == nil {
|
if unixTime > 0 && err == nil {
|
||||||
additionalInfos = append(additionalInfos, "build time "+utils.FormatToLongDateTime(utils.ParseFromUnixTime(unixTime)))
|
additionalInfos = append(additionalInfos, "build time "+utils.FormatUnixTimeToLongDateTimeInServerTimezone(unixTime))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user