logo-MindMajix
PostGoLangGoLang
I
Irshad Mohammad

Posted on 26th July 2024|51 views

0
votes

Golang Time To String

What is time.Time.String() in Golang?

1 answers
Answers
P
Anthony A

Posted on 26th July 2024| views

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)

}

 

Write your answer

STILL GOT QUERIES?

Get a Live FREE Demo

  • Explore the trending and niche courses and learning maps
  • Learn about tuition fee, payment plans, and scholarships
  • Get access to webinars and self-paced learning videos
Name
Course *
Email *
Phone Number