I have a basic understanding of how the interest works, and it's actually per day, however if you pay on time you don't get any interest. Now say I buy something near the end of the due date does that part of the balance count towards the interest, or does it only count towards the next due date?
Your question has two answers.
1) If you paid LAST month's bill in full and on time: Then if you buy something between the billing date and the due date, it'll be interest free until your NEXT due date (~ 6 weeks later). This is the ideal time to buy something. I wait for almost ALL major purchases for this magical period where I get to keep my money in the bank for free for 6 weeks (between the billing date and the due date).
2) If you didn't pay LAST month's bill in full or on time: Then if you buy something between the billing date and the due date, you'll likely be charged interest from the day you bought it.
There was a 3rd option just recently outlawed: You had to have two full months paid in full (including all interest on the interst, see my post above) and on time to not get interest. This deceptive practice made it virtually impossible to get a purchase interst free even if you thought it was interest free if you were ever charged interest.
Conclusion: pay in full and on time every month and you don't have to worry about a thing.