Re: Thanks!
I have now realized that we have a full example for what you actually need:
https://winscp.net/eng/docs/faq_script_modified_files#last_timestamp
https://winscp.net/eng/docs/faq_script_modified_files#last_timestamp