Get total seconds remaining until the next month
()
| 2181 | |
| 2182 | |
| 2183 | def get_time_until_next_month(): |
| 2184 | """Get total seconds remaining until the next month""" |
| 2185 | now = datetime.datetime.now() |
| 2186 | next_month = now.month + 1 if now.month < 12 else 1 |
| 2187 | year = now.year if now.month < 12 else now.year + 1 |
| 2188 | date_of_next_month = datetime.datetime(year, next_month, 1) |
| 2189 | |
| 2190 | remaining_seconds = (date_of_next_month - now).total_seconds() |
| 2191 | |
| 2192 | return remaining_seconds |
| 2193 | |
| 2194 | |
| 2195 | def remove_extra_spaces(text): |
no outgoing calls
no test coverage detected