DateFormatting.zip (59.5 KB)
after some confirmation from our business analysts it turns out that we can’t use the workaround Ewa mentioned above.
I have done some more testing and it seems that Aspose is not mimicking Word behavior in this case.
I have attached input and output files and this is the code i was testing with (using Aspose.Words 18.10 library):
var document = new Document(“InputFiles/(1288332659) Field_Time_336317.docx”);
To be able to replicate this you will need to set your system Date and Time formatting in Control Panel > Clock and Region > Change date, time or number formats.
please switch short time to HH:mm and long time to HH:mm:ss
after setting this you should be able to replicate our issue (time in PDF being displayed in 24 hrs format instead of 12 h as set in word document)
Just as a double check - if we opened either .dotx or .docx file in word and just saved it in PDF format, time setting were preserved and displayed correctly in 12 h format.
Could you please take a look?