With the help of
time.Now() function, we can get the current time in Golang by importing time module.
Return: Return current date and time.
Example #1: In this example, we can see that by using
time.Now() function, we are able to get the current date and time.
Current date and time is: 2009-11-10 23:00:00 +0000 UTC m=+0.000000001
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.