title: Java Dates and Standard Formats
body: <p>As per <a href="http://msdn.microsoft.com/en-us/library/zdtaw1bw.aspx?cs-save-lang=1&amp;cs-lang=csharp#code-snippet-2" rel="nofollow">this C# code from Mircrosoft</a> there is a standard date format such as this:</p>
  
  <pre><code>//       R: Sun, 15 Jun 2008 21:15:07 GMT 
  </code></pre>
  
  <p>My C# code uses "r" like so:</p>
  
  <pre><code>webRequest.Date.ToUniversalTime().ToString("r")
  </code></pre>
  
  <p>How can I create a standard date format like this in Java?</p>
  
  <p>I have this so far:</p>
  
  <pre><code>this.timestamp = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss z").format(new Date());
  </code></pre>
  
  <p>But, I don't know if I should try to write something that will match it or if there is a better way.  My fear is that I will make a mistake and certain dates won't work.</p>