Opening the file document like this:
Document document;
try (InputStream stream = Files.newInputStream(file))
{
document = new Document(stream);
}
And then getting the date:
System.out.println(document.getCreationTime());
The value I get changes depending on the time zone my computer is currently set to.
If I set my computer to Asia/Tokyo, the date I get is “Fri Feb 24 21:27:44 JST 2017”.
If I set my computer back to Australia/Sydney, the date I get is “Fri Feb 24 21:27:44 AEDT 2017”.
These dates are two hours apart, and I don’t believe the result should change merely by being in a different time zone.
The OneNote format documentation appears to state that the value is stored in UTC. Sources:
https://msdn.microsoft.com/en-us/library/dd925038(v=office.12).aspx
https://msdn.microsoft.com/en-us/library/dd947968(v=office.12).aspx
We created a test file at 3:51pm to test, and Aspose got the time as 5:51am. This seems to confirm the theory - 10 hours were subtracted from the date to account for Sydney’s time zone, when the value should have simply been treated as being in UTC in the first place.