Bug 48924

Summary: [Patch] Added a getDate method to DateAndTime that returns Calendar
Product: POI Reporter: Ryan Lauck <ryanlauck>
Component: HWPFAssignee: POI Developers List <dev>
Severity: enhancement    
Priority: P2    
Version: 3.7-dev   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Attachments: svn diff

Description Ryan Lauck 2010-03-16 22:05:48 UTC
Currently there is no easy way to get any useful information out of org.apache.poi.hwpf.usermodel.DateAndTime, so I added a added a getDate() method that returns the date and time as a java.util.Calendar.  I am already using this in production code and thought it would be useful to others.

Note: it currently uses Calendar.getInstance() to get the default time-zone and localization - I don't know if the word binary format stores any localization data but if it does this code may need a further enhancement to initialize the Calendar with said data.
Comment 1 Ryan Lauck 2010-03-16 22:14:35 UTC
Created attachment 25137 [details]
svn diff
Comment 2 Nick Burch 2010-05-26 10:40:51 UTC
I've no idea either about timezones

The way to test would be to work with someone elsewhere in the world, and both of you create a simple file around the same moment. Compare those and see!

Patch applied with slight tweaks in r948455.