February 2018
Intermediate to advanced
340 pages
9h 43m
English
The Sub method of the Time instance is the universal one to find out the difference between two dates. The result is time.Duration, which represents the nanosecond count between these dates.
The functions Since and Until are just a shorter way on how to work out the difference between now and the given date. These work as their names prompts. The Since function returns the same result as time.Now().Sub(t); similarly, the Until returns the same result as t.Sub(time.Now()).
Read now
Unlock full access