title: How to check if date uses 1904 windowing with Apache POI XSSF eventmodel
body: <p>I am writing a program that imports xlsx files with Apache POI eventmodel (SAX/XSSF). I am almost done, but I can't get the correct dates.</p>
  
  <p>I am parsing a cell with date value</p>
  
  <pre><code>&lt;c r="D1" s="1"&gt;
      &lt;v&gt;41319.558333333334&lt;/v&gt;
  &lt;/c&gt;
  </code></pre>
  
  <p>I am using the <code>org.apache.poi.ss.usermodel.DateUtil</code> class to get the date:</p>
  
  <pre><code>DateUtil.getJavaCalendar(doble date, bool use1904windowing);
  </code></pre>
  
  <p>What should I pass as <code>use1904windowing</code> to get correct dates? 
  Temporarily I use <code>false</code>, as this gives me correct dates with my test workbook, but I know I should read that value from somewhere.</p>
  
  <p>There is a record <code>DateWindow1904Record</code> in binary xls format, which I read using HSSF. What is its counterpart in XSSF? 
  Or should I always use <code>false</code>?</p>
  
  <p><strong>EDIT</strong>:
  @rgettman answer pointed me to the solution, but it's not complete.
  In event model you do not have xssfWorkbook object and you can't just getCTWorkbook() of it.</p>
  
  <p>Instead you can create CTWorkbook directly form InputStream:</p>
  
  <pre><code>OPCPackage pkg = OPCPackage.open(filename);
  XSSFReader r = new XSSFReader( pkg );
  InputStream workbookXml = r.getWorkbookData();
  CTWorkbook ctWorkbook = CTWorkbook.Factory.parse(workbookXml);
  boolean isDate1904 = ctWorkbook.getWorkbookPr().getDate1904();
  </code></pre>