If your month to month lease requires you to pay rent on the 1st day of every month and you submitted a 30 day notice to terminate on July 17th, you would most likely still be obligated to pay the full month's rent on August 1st, but would be entitled to a refund for the days covering August 17 to 31. The rationale is that the landlord has no guarantee that you will actually vacate on August 17th.
Nevertheless, notwithstanding whatever it may say in your month to month lease, you can work this out with your landlord. It is possible the landlord will accept pro rated rent payment on August 1st.
Frank W. Chen has been licensed to practice law in California since 1988. The information presented here is general in nature and is not intended, nor should be construed, as legal advice for a particular case. This Avvo.com posting does not create any attorney-client relationship with the author. For specific advice about your particular situation, please consult with your own attorney.