def get_seconds_until_next_day ( now = None ) : if now is None : now = arrow . utcnow ( ) return ( now . ceil ( 'day' ) - now ) . seconds
python arrow now minus four days
Returns the number of seconds until the next day ( utc midnight ) . This is the long - term rate limit used by Strava . : param now : A ( utc ) timestamp : type now : arrow . arrow . Arrow : return : the number of seconds until next day as int
def get_seconds_until_next_day(now=None):
    """
    Returns the number of seconds until the next day (utc midnight). This is the long-term rate limit used by Strava.
    :param now: A (utc) timestamp
    :type now: arrow.arrow.Arrow
    :return: the number of seconds until next day, as int
    """
    if now is None:
        now = arrow.utcnow()
    return (now.ceil('day') - now).seconds