Skip to content
Advertisement

Tag: timestamp-with-timezone

Error while converting timestamp string with timezone (+0000) to Timestamp in Presto

I am trying to convert a timestamp string to timestamp with date_parse, but keep getting an error. Any suggestions? I am working on Presto SQL. I also refered: http://teradata.github.io/presto/docs/127t/functions/datetime.html, but couldnt find anything that can deal with +0000 i.e Timezone. I tried: throws me error Invalid format: “2021-05-22 04:00:00 +0000” is malformed at “+0000″” Also tried this: throws me error

Select timestamp with time zone, but ignore seconds

I’m selecting a timestamptz from a PosgreSQL database. I want my SELECT to return only the date, hours and minutes. No seconds. Can I set the date format in my psql SELECT to accommodate this? Answer You can use date_trunc() to truncate seconds and still return a timestamptz: Or you can use to_char() to return a formatted timestamp as text

Advertisement