Working with dates

In this subsection, you will learn how to parse strings that denote dates in Go. Doing this still requires the use of the time.Parse() function.

The Go constants for working with dates are Jan for parsing the three-letter abbreviation used for describing a month, 2006 for parsing the year, and 02 for parsing the day of the month. If you use January instead of Jan, you will get the long name of the month instead of its three-letter abbreviation, which makes perfect sense.

Additionally, you can use Monday for parsing strings that contain a long weekday string and Mon for the abbreviated version of the weekday.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.143.4.181