Hi Jean-Pascal,
Thanks for your inquiry. I have tested the scenario using the following code example and have found the time zone issue with comments. However, to reproduce the exact issue which you are facing, we need following detail for investigation purposes.
-
Please attach your input Word document.
-
Please create a standalone/runnable simple Java application that demonstrates the code (Aspose.Words code) you used to generate your output document.
-
Please attach the output Word file that shows the undesired behavior.
As soon as you get these pieces of information to us we’ll start our investigation into your issue.
String date = "12/01/2014 01:15:30";
java.util.Date utilDate = null;
SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy hh:mm:ss");
utilDate = formatter.parse(date);
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.write("Some text is added.");
System.out.println(utilDate);
Comment comment = new Comment(doc, "Awais Hafeez", "AH", utilDate);
builder.getCurrentParagraph().appendChild(comment);
comment.getParagraphs().add(new Paragraph(doc));
comment.getFirstParagraph().getRuns().add(new Run(doc, "Comment text."));
System.out.println(comment.getDateTime());
doc.save(MyDir + "out.docx");
Document doc2 = new Document(MyDir + "out.docx");
Comment comment2 = (Comment)doc2.getChild(NodeType.COMMENT, 0, true);
System.out.println(comment2.getDateTime());