title: PHP date() returning format yyyy-mm-ddThh:mm:ss.uZ
body: <p>I have checked out the following question/responses: 
  <a href="https://stackoverflow.com/questions/15574434/how-do-i-get-the-format-of-yyyy-mm-ddthhmmss-fffz-in-php">How do I get the format of “yyyy-MM-ddTHH:mm:ss.fffZ” in php?</a>
  The responses include links to Microsoft documentation to format dates but these do not work in PHP.</p>
  
  <p>The the top answer suggest</p>
  
  <p><code>date('Y-m-dTH:i:s.uZ')  //for the current time</code></p>
  
  <p>This outputs
  <code>2013-03-22EDT12:56:35.000000-1440016</code></p>
  
  <p><strong>Background</strong></p>
  
  <p>I am working with an API which requires a timestamp in the format above.  The API is based in the UK (GMT) and my server is in Australia (AEST).</p>
  
  <p>The example given in the API documentation ask for the date to be in this format:</p>
  
  <p><code>2011-07-15T16:10:45.555Z</code></p>
  
  <p>The closest I can get to this is date('c') which outputs:</p>
  
  <p><code>2014-07-03T16:41:59+10:00//Notice the Z is replaced with a time diff in hours</code></p>
  
  <p>I believe the 'Z' refers to a Zone but it is not mentioned in the PHP documentation. </p>
  
  <p>Unfortunatly when I post this format, the API is reading the time and taking 10 hours off. I get an error saying that the date cannot be in the past (as it is checking against the local time in Melbourne, but seeing a time 10 hours earlier).</p>
  
  <p>I have tried trimming the timestamp to remove the +1000 which the API accepts, but the record is showing as created as 10 hours earlier.</p>
  
  <p>I need to match the timestamp required but I cannot find any way to replicate the above output, in PHP for Melbourne, Australia.  Any assistance is much appreciated.</p>
  
  <p><em>First question on SO so please let me know how I have gone</em></p>