Formatting postgres date in Time format

When I recive from postgres database a recieved record looks like this

{1 2 1 placed false 2013-06-01 00:00:00 +0000 +0000}

where 2013-06-01 00:00:00 +0000 +0000 is postgres Date type and my model object has a field of type time.Time

How can I format that Time field into shorter 2013-06-01 representation?

2 Likes

Just:

fmt.Println(yourDateTimeField.Format("02-Jan-2006"))
3 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.