github.com/onwsk8r/gotime (go): Package gotime adds some handy functionality to the Golang time package.  One of the main functions of this library is parsing ISO-8601 dates that do not include the full RFC3339 format. For example, something like time.Time.UnmarshalJSON("2018-07-14") will fail, whereas something like time.Time.UnmarshalJSON("2018-04-14 08:23:35Z") will succeed. The format constraints this library uses came from https://en.wikipedia.org/wiki/ISO_8601 on 2018-195T10-05.  The functions in equality.go ({Date,Time}Equals* and SameTime) can be used to compare part of a time.Time, for example to see if the dates are the same irrespective of the time zone or if just the time portion is the same down to the second.  search.go contains functions for finding the first, last, and nth occurrence of a particular day in a month. These are handy, for example, when figuring out the date of a holiday such as Thanksgiving in the United States.  The word "format" is used herein to mean "a valid first argument to time.Parse()".  The Get{Date,Time}Format functions interrogate their string parameter, which should be an ISO-8601-compatible string, to determine the proper parsing format if possible. The difference between the Fast and Safely functions is that the former assume the input is valid while the latter will error if not. The Fast functions are fast because they use as few rudimentary string functions as possible to narrow down the possibilities and do no verification of the source value. The Safely functions are safer because they use regular expressions and determine the type using the "if it quacks like a duck" method, however they would not prevent you from passing a time like 99:00  Be sure to pass the entire timestamp to each function. The DateParser and TimeParser variables are set to the Fast functions by default, and this library uses those variables internally to determine which set of functions to use.
Keywords: golang|golang-package|time