2808 explained code solutions for 75 technologies


golangHow to format time with microseconds


package main

import (
  "fmt"
  "time"
)

func main() {
	ct := time.Now()
	fmt.Println(ct.Format("15:04:05.000000"))
}ctrl + c
time.Now()

returns current date time

Format

formats datatime

.000000

Adds microseconds to time format