Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Every program is a part of some other program, and rarely fits.


devel / comp.lang.python / Re: Timezone for datetime.date objects

SubjectAuthor
o Re: Timezone for datetime.date objectsMorten W. Petersen

1
Re: Timezone for datetime.date objects

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: morp...@gmail.com (Morten W. Petersen)
Newsgroups: comp.lang.python
Subject: Re: Timezone for datetime.date objects
Date: Sun, 6 Mar 2022 13:46:39 +0100
Lines: 83
Message-ID: <mailman.210.1646587741.2329.python-list@python.org>
References: <CAEtLV=pV-TP6WuBvoLYNfReHUyjKaJqpRqj0W8kkjeT5eLMJdQ@mail.gmail.com>
<YhvqhXTRobKsoECi@cskk.homeip.net>
<CAPTjJmqLXE+=A6GLLt200Zo0o-E9bS10L1N+5HGchm9DOxrR5A@mail.gmail.com>
<CAEtLV=qYmx9+n15rqbaX7i8RZPs7hnGu_prhYHqdZ671PdTVaw@mail.gmail.com>
<20220302171754.a2w3v4b2uyryj4sz@hjp.at>
<CAEtLV=ok=2LeZuKF0ir6cAUh51C+u1B3dD6WUNq86F1ya+aOQg@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de xX5/Tqq4WbmvDQPUbdGt5g0v4u8AXQDVzlorBUKsb1KQ==
Return-Path: <morphex@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=lflrMl0f;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: UNSURE 0.230
X-Spam-Level: **
X-Spam-Evidence: '*H*': 0.54; '*S*': 0.00; '2022': 0.05; 'is.': 0.05;
'&gt;&gt;&gt;': 0.07; 'mar': 0.07; 'cc:addr:python-list': 0.09;
'datetime': 0.09; 'later,': 0.09; 'train': 0.09; '&gt;': 0.14;
'applies': 0.16; 'context.': 0.16; 'crypto': 0.16; 'date,': 0.16;
'holzer': 0.16; 'shortly': 0.16; 'specified,': 0.16; 'specify':
0.16; 'wrote:': 0.16; 'probably': 0.17; "aren't": 0.19;
'cc:addr:python.org': 0.20; 'depends': 0.25; 'saying': 0.25;
'cc:2**0': 0.25; 'programming': 0.25; 'leave': 0.27; 'bit': 0.27;
'coming': 0.27; 'done': 0.28; '>>>': 0.28; 'wrong': 0.28;
'computer': 0.29; 'think': 0.32; "doesn't": 0.32; 'everyone':
0.32; 'context': 0.32; 'end.': 0.32; 'specified': 0.32; 'url-
ip:91/8': 0.32; 'message-id:@mail.gmail.com': 0.32; 'but': 0.32;
"i'm": 0.33; "i'll": 0.33; 'subject:for': 0.33; 'someone': 0.34;
'same': 0.34; 'mean': 0.34; 'header:In-Reply-To:1': 0.34;
'received:google.com': 0.34; '"the': 0.35; 'definitely': 0.35;
'subject:skip:d 10': 0.35; 'yes,': 0.35; 'close': 0.35;
'from:addr:gmail.com': 0.35; 'couple': 0.37; "it's": 0.37;
'received:209.85': 0.37; 'could': 0.38; 'means': 0.38;
'received:209': 0.39; 'received:209.85.208': 0.39; 'scheduled':
0.39; 'wed,': 0.39; 'beginning': 0.40; 'date.': 0.40; 'seconds':
0.40; 'something': 0.40; 'should': 0.40; 'url-ip:216/8': 0.60;
'skip:0 20': 0.61; 'url-ip:142.250.179/24': 0.61; 'day,': 0.62;
'reasonable': 0.62; 'url:user': 0.62; 'here': 0.62; 'days': 0.62;
'url-ip:142.250.179.174/32': 0.63; 'between': 0.63; 'range': 0.64;
'15th': 0.64; 'music': 0.64; 'probability': 0.64; 'url-ip:198/8':
0.65; 'url:instagram': 0.65; 'less': 0.65; 'pay': 0.65; 'day':
0.66; 'time.': 0.66; 'earlier': 0.67; 'time,': 0.67; 'right':
0.68; 'day.': 0.68; 'exactly': 0.68; 'anytime': 0.69; 'playing':
0.69; 'smooth': 0.69; 'transfer': 0.69; 'terms': 0.70;
'instagram': 0.70; 'url:info': 0.71; 'late': 0.73; 'future,':
0.76; 'period.': 0.76; 'business': 0.77; 'bank': 0.78; 'period':
0.81; '(like': 0.84; 'implies': 0.84; 'match.': 0.84; 'somebody':
0.91; 'implied': 0.93; 'bill': 0.95
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
h=mime-version:references:in-reply-to:from:date:message-id:subject:to
:cc; bh=m4psU3gLhyxAETeCLKrrInXL9lHVRCebws9qAx4wsIA=;
b=lflrMl0fxmhpvcK4ipwT6eWRKtpfAuMYZWx4MrHvGe9wOWN49yLn2D/cEs4tn3/Db6
Wpk+E5FOeyVp/1aYWHd5EJKJACuwi05B1JE/Vkn4vQDK2GWbVN4QfxiRVZrEltERzQms
cXduaQLk5XojNEMMXv+OuVeYyxxTnKea5uzCthEsC95DC21A3AiOfWhJJJouyQqstXEz
vbQJ1mrUb+y9m3P+CoyznUbnvHJqJCyzlm4SPAGjq28ZCWOVwLp0yyW1H9Zd5HyjuwoI
l70o9nyVbC5b+uBskFnKZZM/JlOPOJ3dAs18FjdikqOWsCgVNd1FpyliLSj12tsbUmvp
5MgA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=x-gm-message-state:mime-version:references:in-reply-to:from:date
:message-id:subject:to:cc;
bh=m4psU3gLhyxAETeCLKrrInXL9lHVRCebws9qAx4wsIA=;
b=LGEC2pLJQ1jxaHQCMeKvyVpcutgGGMqLooJzJzCPsLGghc+BUuqWWbkzHVOkTDJjFV
U+kx9p0gmNjC/TqJhRLS1wZ0qWVgK8pShkyON9eNnQGuxxl4FsQg8wq1EtxEYvptB1rq
MVeVpx+Jg8kjg4RVHAH/oeppibma19wtJdTc5a24H9GH3BRrszCCOU1KMVDd4jOu81/1
3tRF5FvpaB/gyDtC0jaswnA8C3DV2j9d8E9MyK3rs7m0hczLNCMnCGhu9XoBsWTpWifW
qRVbxI4zKfOK7qqWkWcZQ0X62hBGdVDEfOEX1cXeciUh95Eu84bEYdHHzq6k44Y31Ct/
gUXg==
X-Gm-Message-State: AOAM531NmBcKildQEn5J7NAVhqrqi7+Xuli5m97ZQcbq30bkIdv2mIJL
I5mIkCv4KSgJ3Vayj30L/RzB6v71JIMWBvbaSGUvl6o1GyA=
X-Google-Smtp-Source: ABdhPJzpJ43XEcXbYoREoTm5SZQuRqX13WLL1A8cvPTxV9y/mbo5G/j+ETcpQrMn7zPTzJK6GjtMOPKv++hmd3DRAQ4=
X-Received: by 2002:a50:e185:0:b0:416:31eb:cbc3 with SMTP id
k5-20020a50e185000000b0041631ebcbc3mr2923372edl.131.1646570810911; Sun, 06
Mar 2022 04:46:50 -0800 (PST)
In-Reply-To: <20220302171754.a2w3v4b2uyryj4sz@hjp.at>
X-Mailman-Approved-At: Sun, 06 Mar 2022 12:29:00 -0500
X-Content-Filtered-By: Mailman/MimeDel 2.1.39
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: <CAEtLV=ok=2LeZuKF0ir6cAUh51C+u1B3dD6WUNq86F1ya+aOQg@mail.gmail.com>
X-Mailman-Original-References: <CAEtLV=pV-TP6WuBvoLYNfReHUyjKaJqpRqj0W8kkjeT5eLMJdQ@mail.gmail.com>
<YhvqhXTRobKsoECi@cskk.homeip.net>
<CAPTjJmqLXE+=A6GLLt200Zo0o-E9bS10L1N+5HGchm9DOxrR5A@mail.gmail.com>
<CAEtLV=qYmx9+n15rqbaX7i8RZPs7hnGu_prhYHqdZ671PdTVaw@mail.gmail.com>
<20220302171754.a2w3v4b2uyryj4sz@hjp.at>
 by: Morten W. Petersen - Sun, 6 Mar 2022 12:46 UTC

On Wed, Mar 2, 2022 at 6:20 PM Peter J. Holzer <hjp-python@hjp.at> wrote:

> On 2022-02-28 23:28:23 +0100, Morten W. Petersen wrote:
> > Well, let's say I specify the datetime 2022-02-22 02:02 (AM). I think
> > everyone could agree that it also means 2022-02-22 02:02:00:00, to
> > 2022-02-22 02:02:59:59.
>
> I disagree. The datetime 2022-02-22 02:02 specifies a point in time, not
> a time period. It means 2022-02-22 02:02:00.000000000.....
>
> In reality, a point in time may be fuzzy. "The train departs at 02:02"
> definitely doesn't mean that the train will depart exactly at 02:02:00,
> but it also doesn't mean that it will depart between 02:02 and 02:03.
> Rather it's a smooth probability distribution starting a bit before
> 02:02:00 (a train should never leave early, but sometimes clocks are
> wrong or somebody doesn't pay attention) a peak shortly after 02:02:00
> and a very long tail.
>

Well, the precision we have is probably nowhere as close as it will be
possible
to specify in the future, so it depends on context.

But I agree on the train departing time, it should never be before the
scheduled time, and yes, probably peaks right after the departure time.

If I say I'll meet someone at 2 o'clock, that means 14:00, coming 5 minutes
early or late is acceptable. So saying that implies a range in the given
context.

If I have a bill with a due date, it means I have to pay it on that date or
earlier
to do it correctly. Or even a couple of days later, if the due date is a
holiday
and it's not possible to make a bank transfer that day.

But with crypto currencies it is. :)

If I say I'll do something on the 15th of March, it would be reasonable to
think
that means between 06:00 and 21:00 on that day, but having it done at any
time that day would be correct.

So I think the correct interpretation depends on context, and if I say
14:02,
in a computer and programming context, that means 14:02:00 to 14:02:59,
because the seconds aren't specified, and 14:01 would not be a match, and
14:03 would also not be a match.

If I had specified in terms of seconds into that day

>>> (14*60*60)+(2*60)
50520

the implied and correct range would have been 50520.0 to 50520.99999.

>
> > And I think the same applies for a date.
>
> Depends on the context, but without s specific context (like business
> days) I would agree. A day *is* a time period with a beginning and an
> end.
>

Yeah, more or less what I'm saying above.

Regards,

Morten

--
I am https://leavingnorway.info
Videos at https://www.youtube.com/user/TheBlogologue
Twittering at http://twitter.com/blogologue
Blogging at http://blogologue.com
Playing music at https://soundcloud.com/morten-w-petersen
Also playing music and podcasting here:
http://www.mixcloud.com/morten-w-petersen/
On Google+ here https://plus.google.com/107781930037068750156
On Instagram at https://instagram.com/morphexx/

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor