title: MySQL convert from UNIXTIME to ISO8601 with timezone
body: <p>I have some dates in MySQL which are stored as UNIXTIME I want to perform a query where the time is returned in ISO8601 format with the timezone. I am aware that using FROM_UNIXTIME will return the time in the local timezone however I have not been able to print the timezone used. </p>
  
  <p>For example when I ask for a timezone no timezone is returned at all.</p>
  
  <blockquote>
    <p>mysql  -D foobar_db  --execute "select
    FROM_UNIXTIME(time_submit,'%Y-%m-%dT%TZ') as 'time_submit' from table
    where id=389580;"</p>
  
  <pre><code>+----------------------+
  | time_submit          |
  +----------------------+
  | 2014-01-06T14:43:29Z |
  +----------------------+
  </code></pre>
  </blockquote>
  
  <p>This is incredibly frustrating as clearly MySQL knows the timezone when it performs the <code>FROM_UNIXTIME</code> conversion. I feel like I'm missing something obvious.</p>
  
  <p>Edit: It appears ISO8601 defines the timestamp above as being localtime when the offset from UTC is not specified. I want the offset to be returned.</p>