O'Reilly logo

Go Standard Library Cookbook by Radomir Sohlich

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How it works...

The time package contains the Unix function which accepts two int64 arguments, and the seconds and nanoseconds of epoch time. This way, you can get the Time instance from the epoch value.

To obtain the epoch value from the Time instance, the method with the same name as the creation of Time from epoch, Unix, can be called. There is one more method called UnixNano, which returns the count of milliseconds instead of seconds.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required