title: How do I get a valid date format from a string using Pig
body: <p>I have a source record that represents a date like this:   </p>
  
  <pre><code>20151104
  </code></pre>
  
  <p>when I used Pig to load the source file, I defined the record like this:</p>
  
  <pre><code>data_raw = LOAD '/user/hue/myfile.csv' USING PigStorage(',') AS 
  (date:datetime) 
  </code></pre>
  
  <p>Then use the following code to push it to a new format:</p>
  
  <pre><code>data_values = FOREACH data_raw GENERATE ToString(date, 'yyyyMMdd') AS   
  date
  </code></pre>
  
  <p>When I dump the variable out, I get:</p>
  
  <pre><code>(201511040101)
  </code></pre>
  
  <p>Where is the 0101 coming from?   </p>