In this case, I can demonstrate that MS Word is doing this correctly and Aspose is not. This is about a field that is getting updated incorrectly - the built-in properties are just fine, but updating a field based on the last saved time property isn’t working. Let me try to explain further.
The two docx files attached to the original post have been created so that one’s current “Last Saved Time” is in the morning, and one’s is in the evening. Other than that, the files are identical.
In the content of the files, the headers contain some fields that will show a couple of the built-in properties, including “Last Saved Time”.
When we use Aspose to update those fields, no matter what, afterwards field contains an AM time. The “Last Saved Time” in the evening document is 8:39 PM, but after updating the field using Aspose, the field reads “8:39 AM”. Note: doing similar steps using MS Word updates the field correctly to “8:39 PM”. Both Aspose and MS Word update the morning document correctly, it’s just the afternoon document that’s failing.
In case it matters, we are using US English as our region/culture, but I haven’t seen any change in behavior when I change the various time related regional settings on my machine.
The vb file (with a .vb.txt extension) has some code you can use to demonstrate the problem.
The sub “RunTest” will open a document, enumerate and update all its fields, and save it to a new location so you can see the results and compare to the original. A little modification (like filling in the “SourceDir” variable with the source directory) and you should be able to run it and see what I’m talking about. Both the morning and evening files should have different time stamps after running through this test code, but they don’t - they’re exactly the same. The update on the evening document fails, exactly 12 hours off.
Note: there’s a little bit of unneeded code in that file - the subs “UnlinkField” and “RemoveSequence” aren’t needed. I forgot to remove them before sending the sample code.
Please give the test code a try and hopefully you’ll see the problem. Your response seems to focus just on the built-in property, but it’s the field update that’s important - in this case, it does not work correctly if the Last Saved Time is a PM time.