Skip to content

Commit

Permalink
Merge pull request #59 from UlfBj/master
Browse files Browse the repository at this point in the history
Timestamp resolution set to ms
  • Loading branch information
UlfBj authored Nov 25, 2024
2 parents 26ce920 + 3bac429 commit bb7858e
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions utils/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,13 +314,14 @@ func GetTimeInMilliSecs() string {

func GetRfcTime() string {
time.Now()
withTimeZone := time.Now().Format(time.RFC3339Nano) // 2020-05-01T15:34:35+02:00
if withTimeZone[len(withTimeZone)-6] == '+' {
return withTimeZone[:len(withTimeZone)-6] + "Z"
} else {
return withTimeZone
}
return withTimeZone
rfcTime := time.Now().Format(time.RFC3339Nano) // 2020-05-01T15:34:35.123456789+02:00
dotIndex := strings.Index(rfcTime, ".")
if dotIndex != -1 {
rfcTime = rfcTime[:dotIndex+4]
} else if rfcTime[len(rfcTime)-6] == '+' {
rfcTime = rfcTime[:len(rfcTime)-6]
}
return rfcTime + "Z"
}

func FileExists(filename string) bool {
Expand Down

0 comments on commit bb7858e

Please sign in to comment.