13 lines
298 B
Go
13 lines
298 B
Go
package tool
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
func GetTimeDurationString(startTime string, endTime string) string {
|
|
end, _ := time.Parse("2006-01-02 15:04:05", endTime)
|
|
start, _ := time.Parse("2006-01-02 15:04:05", startTime)
|
|
difference := end.Sub(start)
|
|
return difference.Truncate(time.Second).String()
|
|
}
|