An implementation of PHP methods 'strtotime'(not include the relative formats now), 'date_format' in golang.
import (
"fmt"
du "github.com/fefit/dateutil"
)
func main(){
if date, err := du.DateTime("Sep-05-2021 06:07:06pm"); err == nil{
formatted, _ := du.DateFormat(date, "Y-m-d H:i:s")
fmt.Printf("%s", formatted) // Output: 2021-09-05 18:07:06
}
}