I have an object like this:
type searchObj struct {
symbol string
dataType string
fromDate time.Time
toDate time.Time
}
I want to be able to parse out the day, month, and year from the fromDate and the toDate. How can I do this? Is there a better type to use like (Date) because I do not need the time piece of it?
so I want to be able to pass a date like this 02/19/2016 and be able to get data.Day = 19, date.Month = 02, date.Year = 2016.
I was trying something like this:
search.fromDate.Date.Month
search.fromDate.Date.Day
search.fromDate.Date.Year
This is an example of what I am currently using to create the searchObj:
time.Date(2009, time.November, 10, 23, 0, 0, 0, time.UTC)
I am new to Go and thank you for the help!