MCPcopy
hub / github.com/InstaPy/InstaPy / get_time_until_next_month

Function get_time_until_next_month

instapy/util.py:2183–2192  ·  view source on GitHub ↗

Get total seconds remaining until the next month

()

Source from the content-addressed store, hash-verified

2181
2182
2183def 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
2195def remove_extra_spaces(text):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected