I changed the code to use the strDate
and tried to save another document to see what the date is
28-4-2017 15-14-22.jpg

as you can see it is still the time at which the mail was send.
maybe you tried the code with an e-mail that was just send?