In this section, you will learn how to match a date and time string as found in the log files of an Apache web server. To make things even more interesting, you will also learn how to change the date and time format of the log file into a different format. Once again, this requires reading the Apache log file, which is a plain text file, line by line.
The name of the command-line utility is changeDT.go and it will be presented in five parts. Note that changeDT.go is an improved version of the timeDate.go utility presented in Chapter 3, Working with Basic Go Data Types, not only because it gets its data from an external file, but also because changeDT.go uses two regular expressions and therefore it is able to match ...