Posted on 26th March 2023
The Time.String() function in Go language is utilized to generate the time that is formatted by the assistance of that format string. Furthermore, this function is determined beneath the time package. Here, you require to import the "time" package to utilize those functions.
import (
"fmt"
"time"
)
func main() {
Time := time.Date(2019, 9, 10, 8, 45, 19, 0, time.UTC)
t := Time.String()
fmt.Printf("Time without nanoseconds is: %v\n", t)
}
STILL GOT QUERIES?
Copyright © 2013 - 2023 MindMajix Technologies