title: How do I convert #datetime to my local timezone?
body: <p>A column in Power Query converts a JavaScript timezone into UK format:</p>
  
  <pre><code>= #datetime(1970, 1, 1, 0, 0, 0) + #duration(0, 0, 0, [Timestamp]/1000)
  </code></pre>
  
  <p>But this produces the wrong output (-1hr difference), presumably due to UTC / GMT+Summertime differences?</p>
  
  <p>I tried to convert again using the following code:</p>
  
  <pre><code>= DateTimeZone.ToLocal(#datetime(1970, 1, 1, 0, 0, 0) + #duration(0, 0, 0, [Timestamp]/1000))
  </code></pre>
  
  <p>But I get the error: </p>
  
  <pre><code>Expression.Error: We cannot convert the value #datetime(2019, 7, 11, 23, 11, 40) to type DateTimeZone.
  Details:
      Value=11/07/2019 23:11:40
      Type=Type
  </code></pre>
  
  <p>How do I do this properly?</p>
  
  <p><strong>Edit:</strong></p>
  
  <pre><code>Timestamp = Text.BetweenDelimiters([ReceivedTime], "(", ")"), type text
  </code></pre>
  
  <p>where <code>[ReceivedTime]</code> is a JSON date in milli-seconds like: <code>/Date(1562886700000)/</code></p>
  
  <p>There may be a more sensible way to convert a JSON date without resorting to <code>Text</code> methods.</p>
  
  <p>The resulting solution should display correctly in Power BI reports - the reports should display all datetimes in the user's Local Timezone.</p>