Stupid accounts payable question

Sorry if this is not the right subreddit but I'm not an accountant and I have a simple question regarding accounts payable and payments in process that I can't seem to get an answer to in a google search.

Suppose I get an invoice for services rendered for 100 on Jan 10, generate and mail a check for 100 to the vendor on Jan 30 and the check gets cashed on Feb 15.

I credit accounts payable for 100 when I receive the invoice. Do I debit the account payable on Jan 30 when I issue the check or on Feb 15 when the vendor cashes it and it hits my bank account?

Any pointers or references would be appreciated.