We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Time zone aspose

Hello, I use Aspose 10.6.0,
I have date variable with date 13.01.2015 00:00:00 before I use

document.getMailMerge().executeWithRegions(new MailMergeDataSource(tableName, columns, mergefieldsList));

after when document pdf is generate I have one hour less. it’s 12.01.2015 23:00:00.

How I can set timezone in aspose ?

Hi Mireczek,

Thanks for your inquiry. Could you please attach your input Word document here for testing? I will investigate the issue on my side and provide you more information.

Hello,
thank for your reply.
this is template.
Now I cast Date to String and it’s OK, but this strange situation. Why he do date minus 1 white data type Date/TimeStamp

Hi Mireczek,

Thanks for your inquiry. To control the culture used during field calculation, just call Locale.setDefault method to a culture of your choice before invoking field calculation.

Locale currentCulture = Locale.getDefault();
Locale.setDefault(new Locale("pl", "PL"));
Document doc = new Document(MyDir + "in.docx");
// Execute mail merge.
doc.getMailMerge().execute(new String[] { "date" }, new Object[] { new Date() });
doc.save(MyDir + "Out.pdf");
Locale.setDefault(currentCulture);

If you still face problem, please share following detail for investigation purposes.

  • 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.

  • Please attach your target Word document showing the desired behavior. You can
    use Microsoft Word to create your target Word document. I will investigate as to how you are expecting your final document be generated like.