I have a pretty standard date as a string that I need to parse to a date type:
"2016-06-01T23:34:25+00:00"
I'm using 'YYYY-MM-DDTHH24:MI:SS' as the format mask and this query to try to get and parse the date:
SELECT to_date('last_updated_on', 'YYYY-MM-DDTHH24:MI:SS')
AS last_updated_on FROM locations
limit 1
What happens is I get this error:
ERROR: invalid value ":2" for "MI"
SQL state: 22007
Detail: Value must be an integer.
I've looked all over in the documentation and on SO trying to find out why this is happening, and I'm totally baffled.
I'm using PostgreSQL 9.4