Times and dates
In this section, you are going to learn how to parse time and date strings in Go, how to convert between different time and date formats, and how to print times and dates in the format you desire. Although this task might look insignificant at first, it can be truly critical when you want to synchronize multiple tasks or when your application needs to read the date from one or more text files, or directly from the user.
The time package is the star of working with times and dates in Go; you will see some of its functions in action in this section.
Before learning how to parse a string and convert it into a time or a date, you will see a simple program named usingTime.go that will introduce you to the time package. The program ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access