[45] Results

Golang : Convert int(year) to time.Time type

golang integer-time convert

Problem :

You have integer value such as a year and you want to convert the integer to time.Time type.….... read more


Golang : Convert seconds to minutes and remainder seconds

golang seconds minutes time

Problem:

You have an input seconds in integer that you want to convert into minutes and remainder seconds. How to….... read more


Golang : calculate elapsed run time

golang elapsed-run-time

Calculating elapsed time can be useful for profiling or bench marking purpose. In this short tutorial, we will learn how….... read more


Golang : Get current time

golang get-current-time

Problem :

Need to get current time stamp in Go and display in string.

Solution :

Use the time.Local() and….... read more


Golang : Get time.Duration in year, month, week or day

golang date-time-stampelapsed time-duration convert

Problem:

When using time.Until() or time.Since() functions, the time.Duration type have methods such as Hour(), Minutes(), Nanoseconds() and Seconds() to….... read more


Golang : Convert file unix timestamp to UTC time example

golang json-time nano-seconds milli-seconds time-unix

This tutorial is my own notes from helping out a friend from my working days in Indonesia. Putting it here….... read more


Golang : Get local time and equivalent time in different time zone

golang time-zone load-location time-in-location

Problem :

You want to show your website visitor the local time(on your server) and the equivalent time in another….... read more


Golang : ISO8601 Duration Parser example

golang iso8601 duration-parser time

An example on how to parse ISO-8601 duration in string format and convert it to time.Duration type. However, this example….... read more


Advertisement