main.go171 chars12 lines
Output: October 13, 2014 11:13 am
In this code, we use the time
package to create a time.Time
object with our desired date and time. Then, we use the Format
method of the time.Time
object to format the date string according to the layout string "January 2, 2006 3:04 pm". The layout string specifies the order and format of the various components of the date and time.
gistlibby LogSnag