我正在学习如何用PDFBox生成PDF。到目前为止,我成功地创建了文档并修改了基本的元数据。
不过,我确实对创作的日期有问题。我尝试了很多事情,这是最符合逻辑的:
//My PDDocument is called "document".
PDDocumentInformation info = document.getDocumentInformation();
info.setCreationDate(Calendar.getInstance());当右键单击生成的PDF并选择"properties“时,结果是mar 28 jun 2011 12:28:36 CEST。(mar意为"mardi",法语为星期二)。我的问题是,正确的时间应该是12:28:36 GMT+1。
当我打印System.out.println(Calendar.getInstance());时,它会返回(...)zone=sun.util.calendar.ZoneInfo[id="Europe/Zurich",(...) (按需提供完整内容),这是正确的!
那么,问题在哪里?
发布于 2011-07-07 06:25:11
你的代码没有问题。如果您在dst期间在法国运行,当地时间应该是GMT+2,而GMT+2与CEST相同。
https://stackoverflow.com/questions/6505196
复制相似问题