Answers for "time.add golang"

Go
1

golang sleep

package main

import (
    "fmt"
    "time"
)

func main() {
    fmt.Printf("Current Unix Time: %vn", time.Now().Unix())

    time.Sleep(2 * time.Second)

    fmt.Printf("Current Unix Time: %vn", time.Now().Unix())
}
Posted by: Guest on November-28-2020
2

go packae unix time

package main

import (
	"fmt"
	"time"
)

func unixtime() {
	fmt.Println(time.Now().Unix())
}
Posted by: Guest on July-05-2020
0

golang time.Add with variables

timein := time.Now().Local().Add(time.Hour * time.Duration(Hours) +
                                 time.Minute * time.Duration(Mins) +
                                 time.Second * time.Duration(Sec))
Posted by: Guest on August-20-2020

Browse Popular Code Answers by Language