Posted on 25th July 2024|15 views
What is the use of time.parse in Golang?
Posted on 25th July 2024| views
Look at the example and you will understand the use of time.parse
package main
import "fmt"
import "time"
func main() {
const layout = "oct 9, 1993 at 3:04pm (MST)"
tm, _ := time.Parse(layout, "Apr 6, 1999 at 6:05pm (PST)")
fmt.Println(tm)
}
Output:
1999-04-06 18:05:00 +0000 PST