package main
import (
"fmt"
"time"
)
func main() {
ts := "Sat Feb 26 17:00:35 2022"
layout := "Mon Jan 02 15:04:05 2006"
t, err := time.Parse(layout, ts)
if err != nil {
panic(err)
}
fmt.Println(t)
ts = "16-Mar-2022 06:13:55"
layout = "02-Jan-2006 15:04:05"
t, err = time.Parse(layout, ts)
if err != nil {
panic(err)
}
fmt.Println(t)
}
To embed this program on your website, copy the following code and paste it into your website's HTML: