I was thinking to code it without any help of pre-existing class, but it seems it is complicated. Later I realized that the question is to just substract 1 second from given day.
Some examples: Local time, Australia/Melbourne
2018-07-26T00:00:00 to 2018-07-25T23:59:59
2018-08-01T00:00:00 to 2018-07-31T23:59:59