I know that it's wrong to edit code in a question/answer, as discussed in "When is it appropriate to edit someone else's code?" and "How far can I refactor someone else's code?". Instead of editing the code it is suggested to "leave a comment and let the author correct it".
I also know that it's wrong to post duplicate answers: basically the same code as another answer but with a few fixes (real fixes like memory leaks, not typos) and possibly another description of the code/solution.
My question is:
Given that I have already commented the suggested changes on an answer. Is it better to post the same answer but modified or is it better to edit the original answer or should I really do neither and just forget about it (after commenting).
I'm seeing certain bad practices and misunderstood code in both questions and answers and would like to reduce the risk of these spreading by people finding these answers and copying code. Not everyone reads through all the comments.
Of course I'm intending to substantially improve the answer and not just copy paste the whole thing. One example is this answer, thought it's only a few hours old so there is still a change that the answerer will edit it.
In the above example I would rewrite the code to do proper day calculations (adding seconds is a really bad practice) and not leak the first date object (I've seen many people first create a new object and then assign something else to that variable on the next line) and explain why the other change makes the code work and not just post a bunch of code without a discussion.