Hi Leo, and thank you for this great script !
I didn't find it at first when I searched for something similar.
However, while creating a new topic, I was glad to see it appeared in the suggested existing topics !
I'm not sure why you avoided milliseconds and what are your thoughts about this, but I would think they should be included by default. They are part of the timestamp after all.
Since I wanted to clone the exact timestamp, I needed the milliseconds too.
If it can help someone else (and unless Leo advises against it), the script needs to be modified like this (replace the function DateTimeForCmd() with this one):
Function DateTimeForCmd(d)
DateTimeForCmd = ZeroPad(d.year,4) & "-" & ZeroPad(d.month,2) & "-" & ZeroPad(d.day,2) & " " _
& ZeroPad(d.hour,2) & ":" & ZeroPad(d.min,2) & ":" & ZeroPad(d.sec,2) & "." & ZeroPad(d.ms,3)
End Function
Basically, I only added the following to the existing line:
& "." & ZeroPad(d.ms,3)
Thank you again Leo