I am trying to format todays date in golang and seem to be struggling with something i deem to be quite simple.
I am trying to get todays date in the format of dd-mm-yyy
any ideas?
thanks
I am trying to format todays date in golang and seem to be struggling with something i deem to be quite simple.
I am trying to get todays date in the format of dd-mm-yyy
any ideas?
thanks
It works this way in Go Playground: https://play.golang.org/p/kBjTxZS9Y7
Here is the code:
package main
import (
"fmt"
"time"
)
func main() {
fmt.Println(time.Now().Format("02-01-2006"))
}