Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

There are some things worth dying for. -- Kirk, "Errand of Mercy", stardate 3201.7


devel / comp.lang.python / RE: Resolving Weekday Schedules to Dates

SubjectAuthor
o RE: Resolving Weekday Schedules to Dates<avi.e.gross

1
RE: Resolving Weekday Schedules to Dates

<mailman.65.1658440939.20444.python-list@python.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=23331&group=comp.lang.python#23331

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: <avi.e.gross@gmail.com>
Newsgroups: comp.lang.python
Subject: RE: Resolving Weekday Schedules to Dates
Date: Thu, 21 Jul 2022 18:02:14 -0400
Lines: 24
Message-ID: <mailman.65.1658440939.20444.python-list@python.org>
References: <CAE9rwzPtMLNb3upQq44oDP-ZrQ52FAr787TGn_OZ=Rwxh+WC1Q@mail.gmail.com>
<004c01d89d4d$89a5b290$9cf117b0$@gmail.com>
Mime-Version: 1.0
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de Ue96lKHk9OEq9BbWNuN92A+2iruZsa0Czbo4x3LRd2Dg==
Return-Path: <avi.e.gross@gmail.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=gmail.com header.i=@gmail.com header.b=JOaIG6y3;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.091
X-Spam-Evidence: '*H*': 0.83; '*S*': 0.01; 'absolute': 0.05;
'assumes': 0.07; 'datetime': 0.09; 'import': 0.15; '>>>>': 0.16;
'assuming': 0.16; 'received:209.85.222.174': 0.16; 'received:mail-
qk1-f174.google.com': 0.16; 'times,': 0.16; 'message-
id:@gmail.com': 0.18; 'to:addr:python-list': 0.20; 'code': 0.23;
'library': 0.26; 'simple,': 0.32; 'header:In-Reply-To:1': 0.34;
'received:google.com': 0.34; 'from:addr:gmail.com': 0.35;
'received:209.85': 0.37; 'received:209': 0.39; 'received:100':
0.39; 'received:209.85.222': 0.39; 'want': 0.40; 'above': 0.62;
'needs.': 0.64; 'your': 0.64; 'time,': 0.67; 'and,': 0.69;
'change.': 0.69; 'days,': 0.69; 'seven': 0.70; 'implemented':
0.76; 'need.': 0.84; 'wednesday': 0.91
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
h=from:to:references:in-reply-to:subject:date:message-id:mime-version
:content-transfer-encoding:thread-index:content-language;
bh=FvDtaGfhk2uxv/2FwEV8gcCS/3WRilyasoBI6rRyLTo=;
b=JOaIG6y3n78ZwxZ3ArRolqyrO3pK1KkjdkrX7DAZ68DSbbXrVG7R1kPvQcG8RltVIP
zhfxsuImio8G9hqVINGAGWKqi9KD6eEUCu804E8xF5pDY8+J5DIrFwWlwFFHzSHx6Wl7
HYDSK4DNqbKmMQv0+epcirHmtwknmd0PDtPNIp0Nj6lCSHiXTTcw0+3u+hZJprIHkg5k
3+A3Pa6HoSwtEPhg0AWw5vVTyNLVIGK3AsJFy36B8yJq037U0Jy/4ryF0HwQMo5DZTnW
OlUH7jwhPM2qN7QdqAyyHwJzE6ZCWTGsXAkZWBvfPxtnhe+ZLMHSb/6Vb0kaKLsRQrZC
M97Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=x-gm-message-state:from:to:references:in-reply-to:subject:date
:message-id:mime-version:content-transfer-encoding:thread-index
:content-language;
bh=FvDtaGfhk2uxv/2FwEV8gcCS/3WRilyasoBI6rRyLTo=;
b=JEFyO5iT3LeRjYdkiCve1qQoIir2eFEzBRgS1e20qp0QG1clElkLprCJHVrBVEJIy0
okk+kj8KjfoH+gpurWVTHTllAx94FTZIPrlzleOlNbI0C6QtTSanjEuo0egwd8VRt+ld
Y8/OhNUTBe2BKPinZcMmDEJDULchhZHeMdLD6hq3SsS17Kh4iwEImQgDLZpnggBBSK1E
K/qBE9CX29W9Z8yPXvocPJmpojBrcrfI0mwZd8IqBvVRSmr8C4mK5vI/ZWgXsV4+FPq/
nFN7FCBH35qw3RY9EUVvi1aF6Ie04+QILJOvvZqxR+L2jiWhr19/zPJTDUZdk1913FkJ
q9cQ==
X-Gm-Message-State: AJIora8eDgKRFql4sWUee17daIN2/UF5PMOoiADr9pkySq9rMOIxUMD3
2WAunVjzHDzySfO2gaENJoGzyWaHOuE=
X-Google-Smtp-Source: AGRyM1uFwNvOiyURjHLwoP2SEsLrQ4OVAeWAVxttFlsk3Sv+TdlcYjVqPaE4b5yY+wvtTIZOy9cbIQ==
X-Received: by 2002:a05:620a:270e:b0:6b4:8425:d03c with SMTP id
b14-20020a05620a270e00b006b48425d03cmr464979qkp.732.1658440936644;
Thu, 21 Jul 2022 15:02:16 -0700 (PDT)
In-Reply-To: <CAE9rwzPtMLNb3upQq44oDP-ZrQ52FAr787TGn_OZ=Rwxh+WC1Q@mail.gmail.com>
X-Mailer: Microsoft Outlook 16.0
Thread-Index: AQMIIKgXzAGhQNzugKbj5vbcBkOB3qsqWB+g
Content-Language: en-us
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <004c01d89d4d$89a5b290$9cf117b0$@gmail.com>
X-Mailman-Original-References: <CAE9rwzPtMLNb3upQq44oDP-ZrQ52FAr787TGn_OZ=Rwxh+WC1Q@mail.gmail.com>
 by: <avi.e.gross@gmail.com> - Thu, 21 Jul 2022 22:02 UTC

>>>> Do you know of a library that resolves schedules like every Wednesday
at 3:00pm to absolute time, that is return the datetime of the next
occurrence?

It may be as simple, as this to add seven days, assuming a slip of a second
is not important or even a hour when things change.

Enddate = Begindate + timedelta(days=7)

This assumes you used code like this before:

from datetime import datetime
from datetime import timedelta

Begindate = datetime.strptime("2020-10-11 12:34")

Of course if you want to include times, you adjust to your needs. And, of
course, the above can be implemented as an iterator that keeps producing as
long as you need.


devel / comp.lang.python / RE: Resolving Weekday Schedules to Dates

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor