LastModifiedDate vs LastWriteTime

Hello,
I need to get the most recently modified file in a folder.
I used to use folder.LastModifiedDate and it worked fine. However, in 2025, the file displayed as the most recently modified is actually the last file generated in 2024, not the one modified most recently.
Could anyone explain this behavior or let me know if something has changed with how this method works?

Thanks in advance!

As per my knowledge - there is no difference on this activity and is working as expected. Make sure that the latest change is saved and it is reflected.

On top of this - you could also Order By option and get the first file. Compare and see if it is matching

@Dhouha_Cherif

May be the file has been opened before the bot ran

cheers