title: ICAL Wrong date in outlook (windows and android) but good in Google Calendar and Iphone ical
body: <p>Hi There im busy with an i cal calendar.
  But he display wrong date:</p>
  
  <pre><code>BEGIN:VEVENT
  SUMMARY:TEST EVENT!
  UID:140
  STATUS:CONFIRMED
  DTSTAMP;TZID=Europe/Amsterdam:20170610T220000Z
  DTSTART;TZID=Europe/Amsterdam:20170610T220000Z
  DTEND;TZID=Europe/Amsterdam:20170610T220000Z
  LAST-MODIFIED:20170608T064314Z
  LOCATION:STREET 1 1111 AA CITY
  END:VEVENT
  END:VCALENDAR
  </code></pre>
  
  <p>This sould be date: 11/06/2017 22:00 (Day time Amsterdam)
  In Outlook is the date: 11/06/2017 00:00 (Day time Amsterdam)</p>
  
  <p>This is the rest of my code:</p>
  
  <pre><code>BEGIN:VCALENDAR
  METHOD:PUBLISH
  VERSION:2.0
  PRODID:-//2017/TEST CALENDAR//EN
  BEGIN:VTIMEZONE
  TZID:Europe/Amsterdam
  BEGIN:STANDARD
  DTSTART:20151025T020000
  RDATE:20160327T030000
  TZOFFSETFROM:+0200
  TZOFFSETTO:+0100
  TZNAME:Europe/Amsterdam CET
  END:STANDARD
  BEGIN:STANDARD
  DTSTART:20161030T020000
  RDATE:20170326T030000
  TZOFFSETFROM:+0200
  TZOFFSETTO:+0100
  TZNAME:Europe/Amsterdam CET
  END:STANDARD
  BEGIN:DAYLIGHT
  DTSTART:20150601T073000
  RDATE:20151025T020000
  TZOFFSETFROM:+0100
  TZOFFSETTO:+0200
  TZNAME:Europe/Amsterdam CEST
  END:DAYLIGHT
  BEGIN:DAYLIGHT
  DTSTART:20160327T030000
  RDATE:20161030T020000
  TZOFFSETFROM:+0100
  TZOFFSETTO:+0200
  TZNAME:Europe/Amsterdam CEST
  END:DAYLIGHT
  </code></pre>
  
  <p>I hope someone can help me out!
  Thanks alot!</p>
  
  <p>My php code which generate the Ical is below:</p>
  
  <pre><code>&lt;?php
  date_default_timezone_set('Europe/Amsterdam');
  $querystr ="
  SELECT $wpdb-&gt;posts.* 
  FROM $wpdb-&gt;posts, $wpdb-&gt;postmeta 
  WHERE $wpdb-&gt;posts.ID = $wpdb-&gt;postmeta.post_id 
  AND ( $wpdb-&gt;posts.post_status = 'confirmed'
  OR $wpdb-&gt;posts.post_status = 'pending'
  )
  ORDER BY $wpdb-&gt;posts.post_date DESC";
  $pageposts = $wpdb-&gt;get_results($querystr, OBJECT);
  ?&gt;
  &lt;?php
  header("Content-Type: text/Calendar");
  header("Content-Disposition: inline; filename=TESTAGENDA.ics");
  // the iCal date format. Note the Z on the end indicates a UTC timestamp.
  define('DATE_ICAL', 'Ymd\THis\Z');
  // max line length is 75 chars. New line is \\n
  $output = "BEGIN:VCALENDAR\r\n";
  $output .= "METHOD:PUBLISH\r\n";
  $output .= "VERSION:2.0\r\n";
  $output .= "PRODID:-//2017/TEST AGENDA//EN\r\n";
  
  $output .= "BEGIN:VTIMEZONE\r\n";
  $output .= "TZID:Europe/Amsterdam\r\n";
  $output .= "BEGIN:STANDARD\r\n";
  $output .= "DTSTART:20151025T020000\r\n";
  $output .= "RDATE:20160327T030000\r\n";
  $output .= "TZOFFSETFROM:+0200\r\n";
  $output .= "TZOFFSETTO:+0100\r\n";
  $output .= "TZNAME:Europe/Amsterdam CET\r\n";
  $output .= "END:STANDARD\r\n";
  $output .= "BEGIN:STANDARD\r\n";
  $output .= "DTSTART:20161030T020000\r\n";
  $output .= "RDATE:20170326T030000\r\n";
  $output .= "TZOFFSETFROM:+0200\r\n";
  $output .= "TZOFFSETTO:+0100\r\n";
  $output .= "TZNAME:Europe/Amsterdam CET\r\n";
  $output .= "END:STANDARD\r\n";
  $output .= "BEGIN:DAYLIGHT\r\n";
  $output .= "DTSTART:20150601T073000\r\n";
  $output .= "RDATE:20151025T020000\r\n";
  $output .= "TZOFFSETFROM:+0100\r\n";
  $output .= "TZOFFSETTO:+0200\r\n";
  $output .= "TZNAME:Europe/Amsterdam CEST\r\n";
  $output .= "END:DAYLIGHT\r\n";
  $output .= "BEGIN:DAYLIGHT\r\n";
  $output .= "DTSTART:20160327T030000\r\n";
  $output .= "RDATE:20161030T020000\r\n";
  $output .= "TZOFFSETFROM:+0100\r\n";
  $output .= "TZOFFSETTO:+0200\r\n";
  $output .= "TZNAME:Europe/Amsterdam CEST\r\n";
  $output .= "END:DAYLIGHT\r\n";
  $output .= "END:VTIMEZONE\r\n";
  ?&gt;
  &lt;?php if ($pageposts){ ?&gt;
  &lt;?php global $post; ?&gt;
  &lt;?php foreach ($pageposts as $post): ?&gt;
  &lt;?php $postmeta_reservering = get_post_meta( get_the_ID(), 'rtb', true );
  if ( ! empty( $postmeta_reservering ) ) {
      $aantalpersonen = $postmeta_reservering['party'];
      $emailadres = $postmeta_reservering['email'];
      $telefoonnr = $postmeta_reservering['phone'];
      $ipadres = $postmeta_reservering['ip'];
  }
  ?&gt;
  &lt;?php setup_postdata($post); ?&gt;
  &lt;?php if($post-&gt;post_status == 'confirmed'){$poststatus = 'CONFIRMED';}else{$poststatus = 'IN-PROCESS';}
  $output .= "BEGIN:VEVENT\r\n";
  $output .= "SUMMARY:".$post-&gt;post_title." Tel.:".$telefoonnr." (".$aantalpersonen." pers.)\r\n";
  $output .= "UID:".$post-&gt;ID."\r\n";
  $output .= "STATUS:".$poststatus."\r\n";
  $output .= "DTSTAMP;TZID=Europe/Amsterdam:".date(DATE_ICAL, strtotime($post-&gt;post_date))."\r\n";
  $output .= "DTSTART;TZID=Europe/Amsterdam:".date(DATE_ICAL, strtotime($post-&gt;post_date))."\r\n";
  $output .= "DTEND;TZID=Europe/Amsterdam:".date(DATE_ICAL, strtotime($post-&gt;post_date))."\r\n";
  $output .= "LAST-MODIFIED:".date(DATE_ICAL, strtotime($post-&gt;post_modified))."\r\n";
  $output .= "LOCATION:STREET 01 1111 AA CITY\r\n";
  $output .= "END:VEVENT\r\n";?&gt;
  &lt;?php endforeach; ?&gt;
  &lt;?php
  // close calendar
  $output .= "END:VCALENDAR";
  // loop over events
  echo $output;
  ?&gt;
  &lt;?php }else{ ?&gt;
      &lt;span&gt;No event!&lt;/span&gt;
  &lt;?php } ?&gt;
  </code></pre>