Yes, this is the way I remember. My wife quotes the rhyme and I annoy her by pointing out the following issues:
1 - 3 lines of the rhyme at the end are utterly pointless as it's much easier to just remember that leap years are actually a thing.
2 - The fact that it rhymes doesn't help you remember which months you're talking about. It could quite easily be, "30 days hath September; October, November, December" and it would still rhyme but be wrong.