π Time β
go
import (
"github.com/thuongtruong109/gouse"
)
1. Time element β
Description: Show all time elements
go
func TimeElement() {
println("Second:", gouse.Second())
println("Minute:", gouse.Minute())
println("Hour:", gouse.Hour())
println("Day:", gouse.Day())
println("Month:", gouse.Month())
println("Year:", gouse.Year())
println("Weekday:", gouse.Weekday())
println("Unix:", gouse.Unix())
println("UnixNano:", gouse.UnixNano())
println("UnixMilli:", gouse.UnixMilli())
println("UnixMicro:", gouse.UnixMicro())
gouse.Println("UnixMilliToTime:", gouse.UnixMilliToTime(1000000000))
gouse.Println("UnixMicroToTime:", gouse.UnixMicroToTime(1000000000))
gouse.Println("UnixNanoToTime:", gouse.UnixNanoToTime(1000000000))
}
2. To second β
Description: Convert time to seconds
Input params: (time int64)
go
func ToSecond() {
println("ToSecond:", gouse.ToSecond(1))
}
3. To minute β
Description: Convert time to minutes
Input params: (time int64)
go
func ToMinute() {
println("ToMinute:", gouse.ToMinute(1))
}
4. To hour β
Description: Convert time to hours
Input params: (time int64)
go
func ToHour() {
println("ToHour:", gouse.ToHour(1))
}
5. Sleep second β
Description: Sleep for seconds
Input params: (interval int64)
go
func SleepSecond() {
gouse.SleepSecond(1)
}
6. Sleep minute β
Description: Sleep for minutes
Input params: (interval int64)
go
func SleepMinute() {
gouse.SleepMinute(1)
}
7. Sleep hour β
Description: Sleep for hours
Input params: (interval int64)
go
func SleepHour() {
gouse.SleepHour(1)
}
8. Clock β
Description: Display clock in terminal
go
func Clock() {
gouse.TerminalClock()
}