the answer you got from LisaB4657 is wrong, at least in the state of california. i know this post is old by now, but i wanted to respond with the correct information, since others may have the same question (i got here from google asking the same question).
the short answer is that in CA, if you are on a month-to-month lease (technically a 'periodic rental agreement'), you may move out any day of the month as long as you give 30 days prior notice.
in your case, if you gave proper 30 days notice for oct 20, you should only pay through oct 20; your landlord can't force you to pay for the full month, regardless of when your lease started or when the rent is normally due.
to quote the CA Dept of Consumer Affairs 'Tenants Book':
"You must give the landlord the same amount of notice as there are days between rent payments...You can give the landlord notice any time during the rental period, but you must pay full rent during the period covered by the notice. For example, say you have a month-to-month rental agreement, and pay rent on the first day of each month. You could give notice any time during the month (for example, on the tenth). Then, you could leave 30 days later (on the tenth of the following month, or earlier if you chose to). But you would have to pay rent for the first 10 days of the next month whether you stay for those 10 days or move earlier. (Exception: You would not have to pay rent for the entire 10 days if you left earlier,
and the landlord rented the unit to another tenant during the 10 days,
and the new tenant paid rent for all or part of the 10 days.)"
see the Consumer Affairs site for more info:
http://www.dca.ca.gov/publications/l...ving-out.shtml