How should timezones be formatted In Matlab, when inserting a string into a postgresql field timestamp with time zone?
<p>I have no problems inserting strings of format 'yyyy-mm-dd hh:mm:ss' into a timestamp with time zone field in my PostgreSQL database using the Matlab <code>datainsert</code> function. However, I can't seem to work out how to include a time zone in the string itself, so Postgres assumes that it has the timezone of my locale.</p>

<p>For example</p>

<pre><code>create table tmp_test (
id serial primary key,
time timestamp with time zone NOT NULL
);
</code></pre>

<p>Then, this works:</p>

<pre><code>datainsert(conn, 'tmp_test', {'time'}, {'2016-09-15 03:45:49.326'})
</code></pre>

<p>but this doesn't:</p>

<pre><code>&gt;&gt; datainsert(conn, 'tmp_test', {'time'}, {'2016-09-15 03:45:49.326 +00:00'})
Error using database/datainsert (line 301)
Unable to insert element in row 1 column 1, 2016-09-15 03:45:49.326 +00:00. Timestamp format must be yyyy-mm-dd
hh:mm:ss[.fffffffff]
</code></pre>