Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

The man on tops walks a lonely street; the "chain" of command is often a noose.


computers / comp.sys.raspberry-pi / Re: Time shift

SubjectAuthor
* Time shiftDietmar Mysliwietz
+* Re: Time shiftLew Pitcher
|`- Re: Time shiftDietmar Mysliwietz
+- Re: Time shiftDavid Taylor
+* Re: Time shiftR.Wieser
|`* Re: Time shiftR.Wieser
| `* Re: Time shiftDietmar Mysliwietz
|  +* Re: Time shiftThe Natural Philosopher
|  |`* Re: Time shiftDietmar Mysliwietz
|  | +* Re: Time shiftR.Wieser
|  | |`* Re: Time shiftThe Natural Philosopher
|  | | `* Re: Time shiftR.Wieser
|  | |  +* Re: Time shiftAhem A Rivet's Shot
|  | |  |+* Re: Time shiftR.Wieser
|  | |  ||`* Re: Time shiftAhem A Rivet's Shot
|  | |  || `* Re: Time shiftR.Wieser
|  | |  ||  `- Re: Time shiftThe Natural Philosopher
|  | |  |`- Re: Time shiftThe Natural Philosopher
|  | |  `- Re: Time shiftThe Natural Philosopher
|  | +- Re: Time shiftPancho
|  | `* Re: Time shiftPancho
|  |  +* Re: Time shiftPancho
|  |  |`* Re: Time shiftPancho
|  |  | `* Re: Time shiftThe Natural Philosopher
|  |  |  `- Re: Time shiftPancho
|  |  `* Re: Time shiftAhem A Rivet's Shot
|  |   `* Re: Time shiftPancho
|  |    `* Re: Time shiftAhem A Rivet's Shot
|  |     `* Re: Time shiftPancho
|  |      `* Re: Time shiftAhem A Rivet's Shot
|  |       `* Re: Time shiftPancho
|  |        `* Re: Time shiftMartin Gregorie
|  |         `* Re: Time shiftPancho
|  |          `- Re: Time shiftMartin Gregorie
|  `* Re: Time shiftDietmar Mysliwietz
|   `* Re: Time shiftR.Wieser
|    `* Re: Time shiftAhem A Rivet's Shot
|     `* Re: Time shiftR.Wieser
|      `* Re: Time shiftDietmar Mysliwietz
|       `- Time shiftVincent Coen
+- Re: Time shiftMartin Gregorie
`* Re: Time shiftMichael Schütz
 `* Re: Time shiftDietmar Mysliwietz
  `* Re: Time shiftNY
   `- Re: Time shiftDietmar Mysliwietz

Pages:12
Time shift

<u6khd4$195qh$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6492&group=comp.sys.raspberry-pi#6492

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dmysliwi...@web.de (Dietmar Mysliwietz)
Newsgroups: comp.sys.raspberry-pi
Subject: Time shift
Date: Sat, 17 Jun 2023 16:53:23 +0200
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <u6khd4$195qh$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 17 Jun 2023 14:53:24 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="4c9436ee0ea28a7926540b00d8399787";
logging-data="1349457"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/cORurS66BpqEN8RsiefOd"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.12.0
Cancel-Lock: sha1:iyB5b+ty108JlSWkf4kFsolXaqc=
Content-Language: Deutsch - neue Rechtschreibung
 by: Dietmar Mysliwietz - Sat, 17 Jun 2023 14:53 UTC

Hallo,

I have a python-script which is called at 0 and 30 minutes at every hour
from a cronjob:

0,30 * * * * sudo python3 /*****

In the script I call the current time:

akdatum = datetime.datetime.today()
akzeit = akdatum.time()
akzeitstr = akzeit.strftime('%H:%M')

At 0 minutes the returned hour is one hour BEFORE the real hour.
At 30 minutes the returned hour is the correct hour.

Any ideas ?

Thank you.

Dietmar.

Re: Time shift

<u6km34$18d2d$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6493&group=comp.sys.raspberry-pi#6493

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: lew.pitc...@digitalfreehold.ca (Lew Pitcher)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: Time shift
Date: Sat, 17 Jun 2023 16:13:24 -0000 (UTC)
Organization: The Pitcher Digital Freehold
Lines: 44
Message-ID: <u6km34$18d2d$1@dont-email.me>
References: <u6khd4$195qh$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 17 Jun 2023 16:13:24 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="718e0be2efadaf89213bff9ebb1f05fd";
logging-data="1324109"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18al8ymkQ+Xadpnn/M/sTPbhfE1yuf/L98="
User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508
git://git.gnome.org/pan2)
Cancel-Lock: sha1:9hA9fT2ELkB+BMjIKwzwFv7W8WE=
 by: Lew Pitcher - Sat, 17 Jun 2023 16:13 UTC

On Sat, 17 Jun 2023 16:53:23 +0200, Dietmar Mysliwietz wrote:

> Hallo,
>
> I have a python-script which is called at 0 and 30 minutes at every hour
> from a cronjob:
>
> 0,30 * * * * sudo python3 /*****
>
> In the script I call the current time:
>
> akdatum = datetime.datetime.today()
> akzeit = akdatum.time()
> akzeitstr = akzeit.strftime('%H:%M')
>
> At 0 minutes the returned hour is one hour BEFORE the real hour.
> At 30 minutes the returned hour is the correct hour.
>
> Any ideas ?

I don't know python, so I can't answer why the on-the-half-hour
executions get the proper time, but the on-the-hour time
discrepancy sounds like a time-zone "summer time" problem.

AIUT, Germany (or at least, parts of Germany) are now on
"summer time", where the wall-clock time is one hour ahead
of the "standard time" clock. It sounds like, for your
on-the-hour execution, you are picking up "standard time"
rather than "summer time".

I note that, from the python documentation at
https://docs.python.org/3/library/datetime.html,
datetime.datetime.today() will "Return the current local
datetime, with tzinfo None." As I said, I don't know
python, so I don't know the impact of "tzinfo None". But...
as "summer time" offsets are usually part of the tzinfo,
perhaps this "tzinfo None" is interfering with your
"summer time" time conversion.

Just a guess. Hope this helps you find the problem.

--
Lew Pitcher
"In Skills We Trust"

Re: Time shift

<u6ks7e$14ski$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6494&group=comp.sys.raspberry-pi#6494

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david-ta...@blueyonder.co.uk.invalid (David Taylor)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: Time shift
Date: Sat, 17 Jun 2023 18:58:06 +0100
Organization: A noiseless patient Spider
Lines: 32
Message-ID: <u6ks7e$14ski$1@dont-email.me>
References: <u6khd4$195qh$1@dont-email.me>
Reply-To: david-taylor@blueyonder.co.uk
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 17 Jun 2023 17:58:06 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="2baffd328e35ade42bb0c505b524f4a2";
logging-data="1208978"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19aiyZBFcYh09XMedszawNipiACDLuAyZ0="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.11.2
Cancel-Lock: sha1:ArDOR0vCCbKF/fX3dHUHc1Jd29k=
Content-Language: en-GB
In-Reply-To: <u6khd4$195qh$1@dont-email.me>
 by: David Taylor - Sat, 17 Jun 2023 17:58 UTC

On 17/06/2023 15:53, Dietmar Mysliwietz wrote:
> Hallo,
>
> I have a python-script which is called at 0 and 30 minutes at every hour
> from a cronjob:
>
> 0,30 * * * * sudo python3 /*****
>
> In the script I call the current time:
>
> akdatum = datetime.datetime.today()
> akzeit = akdatum.time()
> akzeitstr = akzeit.strftime('%H:%M')
>
> At 0 minutes the returned hour is one hour BEFORE the real hour.
> At 30 minutes the returned hour is the correct hour.
>
> Any ideas ?
>
> Thank you.
>
> Dietmar.

I had something similar ans used 29 and 59 minutes past the hour.

In your case why not try xx:00:15 and xx:30:15 or similar?

--
Cheers,
David
Web: https://www.satsignal.eu

Re: Time shift

<u6mbsm$1jqm6$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6495&group=comp.sys.raspberry-pi#6495

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: addr...@is.invalid (R.Wieser)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: Time shift
Date: Sun, 18 Jun 2023 09:31:24 +0200
Organization: A noiseless patient Spider
Lines: 43
Message-ID: <u6mbsm$1jqm6$1@dont-email.me>
References: <u6khd4$195qh$1@dont-email.me>
Injection-Date: Sun, 18 Jun 2023 07:31:34 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="93559f469530275023390ace770fa736";
logging-data="1698502"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19QoN9vJILy2uhAxzqgDUrRjK8eIvYn5WE88JijTxV+9g=="
Cancel-Lock: sha1:LC0mkDJQ7z3mFdR5wxTuLn897gg=
X-MSMail-Priority: Normal
X-Priority: 3
X-RFC2646: Format=Flowed; Response
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
 by: R.Wieser - Sun, 18 Jun 2023 07:31 UTC

Dietmar,

> I have a python-script which is called at 0 and 30 minutes at every hour
> from a cronjob:
>
> 0,30 * * * * sudo python3 /*****
>
> In the script I call the current time:
>
> akdatum = datetime.datetime.today()
> akzeit = akdatum.time()
> akzeitstr = akzeit.strftime('%H:%M')
>
> At 0 minutes the returned hour is one hour BEFORE the real hour.
> At 30 minutes the returned hour is the correct hour.
>
> Any ideas ?

Provide a bit more info and what you already tried yourself ?

-- More info : what does the minutes show in both cases ? Does it match
the clock you are comparing the hours against ? If not ...

IOW, don't stare yourself blind on just the hours.

-- what you already tried yourself : what does the command

print( datetime.datetime.today() )

display ? Does it (closely) match the clock you are comparing the hours
against ?

I've taken your code and printed "akdatum" as well as "akzeitstr". The
hours and minutes match. IOW, the problem might very well not in the code
you posted ...

-- Suggestion : see if you can output "akdatum" to somewhere when the script
is run as a cronjob and see if it matches the clock. If it doesn't ...

Regards,
Rudy Wieser

Re: Time shift

<u6micc$1kbtu$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6496&group=comp.sys.raspberry-pi#6496

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: addr...@is.invalid (R.Wieser)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: Time shift
Date: Sun, 18 Jun 2023 11:22:13 +0200
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <u6micc$1kbtu$1@dont-email.me>
References: <u6khd4$195qh$1@dont-email.me> <u6mbsm$1jqm6$1@dont-email.me>
Injection-Date: Sun, 18 Jun 2023 09:22:20 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="93559f469530275023390ace770fa736";
logging-data="1716158"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/oxA1jyDEFpBL7m2pjSWkrslJu9y4Zp0McTr3hjcfRDw=="
Cancel-Lock: sha1:qY39fXtXPJHJBMUtPhNhIgdqbmo=
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-Priority: 3
X-RFC2646: Format=Flowed; Response
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MSMail-Priority: Normal
 by: R.Wieser - Sun, 18 Jun 2023 09:22 UTC

Dietmar,

"R.Wieser" <address@is.invalid> wrote in message
news:u6mbsm$1jqm6$1@dont-email.me...
....
> Provide a bit more info

You know, I currently do not even know what you are using that code of yours
for (creating a time-stamped file ?) and/or how you determined that the hour
is (sometimes) wrong.

There is a chance you're misunderstanding what you are seeing, or looking at
the wrong output. But with the rather meager info you supplied there is no
way for us to figure any such thing out.

Which might well be why you have so few responses ...

Regards,
Rudy Wieser

Re: Time shift

<u6mr3k$1l69e$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6497&group=comp.sys.raspberry-pi#6497

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: mar...@mydomain.invalid (Martin Gregorie)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: Time shift
Date: Sun, 18 Jun 2023 11:51:16 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 34
Message-ID: <u6mr3k$1l69e$1@dont-email.me>
References: <u6khd4$195qh$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 18 Jun 2023 11:51:16 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="da7701faabe056f6872935dde7a4626c";
logging-data="1743150"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX183ZIRn/t+c2Vvme6P6nSLHI5KlgWUDSoc="
User-Agent: Pan/0.149 (Bellevue; 4c157ba git@gitlab.gnome.org:GNOME/pan.git)
Cancel-Lock: sha1:gIdf5ja5pXI6zhcZIuDT+bgIMQQ=
 by: Martin Gregorie - Sun, 18 Jun 2023 11:51 UTC

On Sat, 17 Jun 2023 16:53:23 +0200, Dietmar Mysliwietz wrote:

> Hallo,
>
> I have a python-script which is called at 0 and 30 minutes at every hour
> from a cronjob:
>
> 0,30 * * * * sudo python3 /*****
>
> In the script I call the current time:
>
> akdatum = datetime.datetime.today()
> akzeit = akdatum.time()
> akzeitstr = akzeit.strftime('%H:%M')
>
> At 0 minutes the returned hour is one hour BEFORE the real hour.
> At 30 minutes the returned hour is the correct hour.
>
> Any ideas ?
>
As the the RPi already a built-in way, crond, of running periodic jobs at
specified intervals, times or dates, why not write a simple bash script
(or Python program).

Running the "man cron" command will tell you all about it.

--

Martin | martin at
Gregorie | gregorie dot org

Re: Time shift

<u6mr4u$1l8k8$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6498&group=comp.sys.raspberry-pi#6498

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dmysliwi...@web.de (Dietmar Mysliwietz)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: Time shift
Date: Sun, 18 Jun 2023 13:51:57 +0200
Organization: A noiseless patient Spider
Lines: 52
Message-ID: <u6mr4u$1l8k8$1@dont-email.me>
References: <u6khd4$195qh$1@dont-email.me> <u6km34$18d2d$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 18 Jun 2023 11:51:58 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="2392f70fb90e1d99ba06176c38db8dc3";
logging-data="1745544"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19/DiW5e1EpxaDPjVbUG1fj"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.12.0
Cancel-Lock: sha1:Rdr3IkfH7gf5+B46eKEqRZT4F9E=
In-Reply-To: <u6km34$18d2d$1@dont-email.me>
Content-Language: Deutsch - neue Rechtschreibung
 by: Dietmar Mysliwietz - Sun, 18 Jun 2023 11:51 UTC

Am 17.06.2023 um 18:13 schrieb Lew Pitcher:
> On Sat, 17 Jun 2023 16:53:23 +0200, Dietmar Mysliwietz wrote:
>
>> Hallo,
>>
>> I have a python-script which is called at 0 and 30 minutes at every hour
>> from a cronjob:
>>
>> 0,30 * * * * sudo python3 /*****
>>
>> In the script I call the current time:
>>
>> akdatum = datetime.datetime.today()
>> akzeit = akdatum.time()
>> akzeitstr = akzeit.strftime('%H:%M')
>>
>> At 0 minutes the returned hour is one hour BEFORE the real hour.
>> At 30 minutes the returned hour is the correct hour.
>>
>> Any ideas ?
>
> I don't know python, so I can't answer why the on-the-half-hour
> executions get the proper time, but the on-the-hour time
> discrepancy sounds like a time-zone "summer time" problem.
>
> AIUT, Germany (or at least, parts of Germany) are now on
> "summer time", where the wall-clock time is one hour ahead
> of the "standard time" clock. It sounds like, for your
> on-the-hour execution, you are picking up "standard time"
> rather than "summer time".
>
> I note that, from the python documentation at
> https://docs.python.org/3/library/datetime.html,
> datetime.datetime.today() will "Return the current local
> datetime, with tzinfo None." As I said, I don't know
> python, so I don't know the impact of "tzinfo None". But...
> as "summer time" offsets are usually part of the tzinfo,
> perhaps this "tzinfo None" is interfering with your
> "summer time" time conversion.
>
> Just a guess. Hope this helps you find the problem.
>

Thank you Lew,

I also thought about timezones. But why it's OK at the 30 minutes time??!!
I just updated to pytz on the Raspberry and wrote some lines with
timezone-infos for Europe/Berlin.

In a few minutes I will see the result.

Dietmar.

Re: Time shift

<u6mrhk$1l8l6$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6499&group=comp.sys.raspberry-pi#6499

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dmysliwi...@web.de (Dietmar Mysliwietz)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: Time shift
Date: Sun, 18 Jun 2023 13:58:43 +0200
Organization: A noiseless patient Spider
Lines: 34
Message-ID: <u6mrhk$1l8l6$1@dont-email.me>
References: <u6khd4$195qh$1@dont-email.me> <u6mbsm$1jqm6$1@dont-email.me>
<u6micc$1kbtu$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 18 Jun 2023 11:58:44 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="2392f70fb90e1d99ba06176c38db8dc3";
logging-data="1745574"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Cj8gI3pIeYez0QrMoxBfa"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.12.0
Cancel-Lock: sha1:LXMkoPa7fyo4nn428auWyFvUriQ=
Content-Language: Deutsch - neue Rechtschreibung
In-Reply-To: <u6micc$1kbtu$1@dont-email.me>
 by: Dietmar Mysliwietz - Sun, 18 Jun 2023 11:58 UTC

Am 18.06.2023 um 11:22 schrieb R.Wieser:
> Dietmar,
>
> "R.Wieser" <address@is.invalid> wrote in message
> news:u6mbsm$1jqm6$1@dont-email.me...
> ...
>> Provide a bit more info
>
> You know, I currently do not even know what you are using that code of yours
> for (creating a time-stamped file ?) and/or how you determined that the hour
> is (sometimes) wrong.
>
> There is a chance you're misunderstanding what you are seeing, or looking at
> the wrong output. But with the rather meager info you supplied there is no
> way for us to figure any such thing out.
>
> Which might well be why you have so few responses ...
>
> Regards,
> Rudy Wieser
>
>

Thank you Rudy,

what I tried was, to wait a few seconds in the Python-script: no success.

And I wrote in the Python-script the time values to a file. There are
the wrong hours too. But the file has the correct timestamp. The RPi has
timezone information (Europe/Berlin).

Now I try timezone information in the Python.

Dietmar.

Re: Time shift

<u6msrv$1l8h8$3@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6500&group=comp.sys.raspberry-pi#6500

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: tnp...@invalid.invalid (The Natural Philosopher)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: Time shift
Date: Sun, 18 Jun 2023 13:21:19 +0100
Organization: A little, after lunch
Lines: 53
Message-ID: <u6msrv$1l8h8$3@dont-email.me>
References: <u6khd4$195qh$1@dont-email.me> <u6mbsm$1jqm6$1@dont-email.me>
<u6micc$1kbtu$1@dont-email.me> <u6mrhk$1l8l6$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 18 Jun 2023 12:21:19 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="1a4ba81bdacba72e3a89d5bc15323eb8";
logging-data="1745448"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Hl6ZW3XqSOS7zAw6e4AOMSfSOV87ie3w="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:E9uvf7tKllPZDXQTrAovvZnGlro=
Content-Language: en-GB
In-Reply-To: <u6mrhk$1l8l6$1@dont-email.me>
 by: The Natural Philosop - Sun, 18 Jun 2023 12:21 UTC

On 18/06/2023 12:58, Dietmar Mysliwietz wrote:
> Am 18.06.2023 um 11:22 schrieb R.Wieser:
>> Dietmar,
>>
>> "R.Wieser" <address@is.invalid> wrote in message
>> news:u6mbsm$1jqm6$1@dont-email.me...
>> ...
>>> Provide a bit more info
>>
>> You know, I currently do not even know what you are using that code of
>> yours
>> for (creating a time-stamped file ?) and/or how you determined that
>> the hour
>> is (sometimes) wrong.
>>
>> There is a chance you're misunderstanding what you are seeing, or
>> looking at
>> the wrong output.  But with the rather meager info you supplied there
>> is no
>> way for us to figure any such thing out.
>>
>> Which might well be why you have so few responses ...
>>
>> Regards,
>> Rudy Wieser
>>
>>
>
> Thank you Rudy,
>
> what I tried was, to wait a few seconds in the Python-script: no success.
>
> And I wrote in the Python-script the time values to a file. There are
> the wrong hours too. But the file has the correct timestamp. The RPi has
> timezone information (Europe/Berlin).
>
It wouldn't be the first time a language-supplied library had some kind
of bug in it.

Not a great Python coder, but can you essentially execute the Linux
'date' command and parse the output?

I have to say I've used date time functions in 'C' and never had an issue.

> Now I try timezone information in the Python.
>
> Dietmar.

--
In a Time of Universal Deceit, Telling the Truth Is a Revolutionary Act.

- George Orwell

Re: Time shift

<0kg3mj-p2lu.ln1@ardbeg.whisky.at.home>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6501&group=comp.sys.raspberry-pi#6501

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: der.schu...@web.de (Michael Schütz)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: Time shift
Date: Sun, 18 Jun 2023 16:23:28 +0200
Lines: 31
Message-ID: <0kg3mj-p2lu.ln1@ardbeg.whisky.at.home>
References: <u6khd4$195qh$1@dont-email.me>
X-Trace: individual.net OfB/BRVt2hyDTZ8D8knrBQJE3FEM62PVYJqmPEjwj8TC/4ltSO
X-Orig-Path: not-for-mail
Cancel-Lock: sha1:JYhlaAwOMhvLv7DJ+71zi8r0kjg=
User-Agent: tin/2.6.2-20221225 ("Pittyvaich") (Linux/6.1.0-9-amd64 (x86_64))
 by: Michael Schütz - Sun, 18 Jun 2023 14:23 UTC

Dietmar Mysliwietz <dmysliwietz@web.de> schrieb:
> Hallo,
>
> I have a python-script which is called at 0 and 30 minutes at every hour
> from a cronjob:
>
> 0,30 * * * * sudo python3 /*****
>
> In the script I call the current time:
>
> akdatum = datetime.datetime.today()
> akzeit = akdatum.time()
> akzeitstr = akzeit.strftime('%H:%M')
>
> At 0 minutes the returned hour is one hour BEFORE the real hour.
> At 30 minutes the returned hour is the correct hour.
>
> Any ideas ?
>
Yeah, just an idea. Try in crontab

0,30 * * * * sudo { sleep 1; python3 /*****; } (or so)

> Thank you.
>
> Dietmar.

--
Politik ist die Unterhaltungsabteilung der Industrie.
Frank Zappa

Re: Time shift

<u6n66g$1mb87$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6502&group=comp.sys.raspberry-pi#6502

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dmysliwi...@web.de (Dietmar Mysliwietz)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: Time shift
Date: Sun, 18 Jun 2023 17:00:32 +0200
Organization: A noiseless patient Spider
Lines: 56
Message-ID: <u6n66g$1mb87$1@dont-email.me>
References: <u6khd4$195qh$1@dont-email.me> <u6mbsm$1jqm6$1@dont-email.me>
<u6micc$1kbtu$1@dont-email.me> <u6mrhk$1l8l6$1@dont-email.me>
<u6msrv$1l8h8$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 18 Jun 2023 15:00:32 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="2392f70fb90e1d99ba06176c38db8dc3";
logging-data="1780999"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19yuyla4v3lQs9oj4f6P/Yj"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.12.0
Cancel-Lock: sha1:2qeLXQFrjdfBCooBEe5vuBHilkg=
Content-Language: Deutsch - neue Rechtschreibung
In-Reply-To: <u6msrv$1l8h8$3@dont-email.me>
 by: Dietmar Mysliwietz - Sun, 18 Jun 2023 15:00 UTC

Am 18.06.2023 um 14:21 schrieb The Natural Philosopher:
> On 18/06/2023 12:58, Dietmar Mysliwietz wrote:
>> Am 18.06.2023 um 11:22 schrieb R.Wieser:
>>> Dietmar,
>>>
>>> "R.Wieser" <address@is.invalid> wrote in message
>>> news:u6mbsm$1jqm6$1@dont-email.me...
>>> ...
>>>> Provide a bit more info
>>>
>>> You know, I currently do not even know what you are using that code
>>> of yours
>>> for (creating a time-stamped file ?) and/or how you determined that
>>> the hour
>>> is (sometimes) wrong.
>>>
>>> There is a chance you're misunderstanding what you are seeing, or
>>> looking at
>>> the wrong output.  But with the rather meager info you supplied there
>>> is no
>>> way for us to figure any such thing out.
>>>
>>> Which might well be why you have so few responses ...
>>>
>>> Regards,
>>> Rudy Wieser
>>>
>>>
>>
>> Thank you Rudy,
>>
>> what I tried was, to wait a few seconds in the Python-script: no success.
>>
>> And I wrote in the Python-script the time values to a file. There are
>> the wrong hours too. But the file has the correct timestamp. The RPi
>> has timezone information (Europe/Berlin).
>>
> It wouldn't be the first time a language-supplied library had some kind
> of bug in it.
>
> Not a great Python coder, but can you essentially execute the Linux
> 'date' command and parse the output?
>
> I have to say I've used date time functions in 'C' and never had an issue.
>
>> Now I try timezone information in the Python.
>>
>> Dietmar.
>

I don't think that there is a bug in the library. Where the problem is
... getting crazy

The date at the commandline returnes the correct time.

Dietmar.

Re: Time shift

<u6n6dg$1mb87$2@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6503&group=comp.sys.raspberry-pi#6503

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dmysliwi...@web.de (Dietmar Mysliwietz)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: Time shift
Date: Sun, 18 Jun 2023 17:04:16 +0200
Organization: A noiseless patient Spider
Lines: 36
Message-ID: <u6n6dg$1mb87$2@dont-email.me>
References: <u6khd4$195qh$1@dont-email.me>
<0kg3mj-p2lu.ln1@ardbeg.whisky.at.home>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 18 Jun 2023 15:04:17 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="2392f70fb90e1d99ba06176c38db8dc3";
logging-data="1780999"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+tIu8kPyKrkojkzt2FHWPP"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.12.0
Cancel-Lock: sha1:PMnvHYqHa+dR5SSDwz8PbyMSq0M=
In-Reply-To: <0kg3mj-p2lu.ln1@ardbeg.whisky.at.home>
Content-Language: Deutsch - neue Rechtschreibung
 by: Dietmar Mysliwietz - Sun, 18 Jun 2023 15:04 UTC

Am 18.06.2023 um 16:23 schrieb Michael Schütz:
> Dietmar Mysliwietz <dmysliwietz@web.de> schrieb:
>> Hallo,
>>
>> I have a python-script which is called at 0 and 30 minutes at every hour
>> from a cronjob:
>>
>> 0,30 * * * * sudo python3 /*****
>>
>> In the script I call the current time:
>>
>> akdatum = datetime.datetime.today()
>> akzeit = akdatum.time()
>> akzeitstr = akzeit.strftime('%H:%M')
>>
>> At 0 minutes the returned hour is one hour BEFORE the real hour.
>> At 30 minutes the returned hour is the correct hour.
>>
>> Any ideas ?
>>
> Yeah, just an idea. Try in crontab
>
> 0,30 * * * * sudo { sleep 1; python3 /*****; } (or so)
>
>
>> Thank you.
>>
>> Dietmar.
>

Thank you Michael,

that doesn't help. There was a time delay from 10 seconds in the Python
at the begin.

Dietmar.

Re: Time shift

<u6n7rf$1mhbq$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6504&group=comp.sys.raspberry-pi#6504

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dmysliwi...@web.de (Dietmar Mysliwietz)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: Time shift
Date: Sun, 18 Jun 2023 17:28:47 +0200
Organization: A noiseless patient Spider
Lines: 23
Message-ID: <u6n7rf$1mhbq$1@dont-email.me>
References: <u6khd4$195qh$1@dont-email.me> <u6mbsm$1jqm6$1@dont-email.me>
<u6micc$1kbtu$1@dont-email.me> <u6mrhk$1l8l6$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 18 Jun 2023 15:28:47 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="2392f70fb90e1d99ba06176c38db8dc3";
logging-data="1787258"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18+MhHOCnnCeeZpT2J44voe"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.12.0
Cancel-Lock: sha1:plhlFI4Xrsu/3HtBOG5y+XpKKFk=
Content-Language: Deutsch - neue Rechtschreibung
In-Reply-To: <u6mrhk$1l8l6$1@dont-email.me>
 by: Dietmar Mysliwietz - Sun, 18 Jun 2023 15:28 UTC

Am 18.06.2023 um 13:58 schrieb Dietmar Mysliwietz:
>
> Thank you Rudy,
>
> what I tried was, to wait a few seconds in the Python-script: no success.
>
> And I wrote in the Python-script the time values to a file. There are
> the wrong hours too. But the file has the correct timestamp. The RPi has
> timezone information (Europe/Berlin).
>
> Now I try timezone information in the Python.
>
> Dietmar.

I wrote some Phyton-lines:
datum = datetime.datetime.now()
datum2 = datetime.datetime.now(pytz.timezone('Europe/Berlin'))

... and called this script via cronjob at 0,30 * * * *

This script returne the correct time, my 'old big' script didn't.

Dietmar.

Re: Time shift

<u6naiv$1mr65$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6505&group=comp.sys.raspberry-pi#6505

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: addr...@is.invalid (R.Wieser)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: Time shift
Date: Sun, 18 Jun 2023 18:15:06 +0200
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <u6naiv$1mr65$1@dont-email.me>
References: <u6khd4$195qh$1@dont-email.me> <u6mbsm$1jqm6$1@dont-email.me> <u6micc$1kbtu$1@dont-email.me> <u6mrhk$1l8l6$1@dont-email.me> <u6n7rf$1mhbq$1@dont-email.me>
Injection-Date: Sun, 18 Jun 2023 16:15:27 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="93559f469530275023390ace770fa736";
logging-data="1797317"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX196FQ/uBl3nqaklYzRYMXocrBqJDrBOtCkQT2JfrIP6zg=="
Cancel-Lock: sha1:Ul/olCBJprEBEMjizevIgw5vMKA=
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MSMail-Priority: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-RFC2646: Format=Flowed; Response
X-Priority: 3
 by: R.Wieser - Sun, 18 Jun 2023 16:15 UTC

Dietmar,

> I wrote some Phyton-lines:
> datum = datetime.datetime.now()
> datum2 = datetime.datetime.now(pytz.timezone('Europe/Berlin'))
>
> .. and called this script via cronjob at 0,30 * * * *
>
> This script returne the correct time, my 'old big' script didn't.

It looks like the different accounts (users) can have their own timezones.

Suggestion : see, to verify the above assumption, what "utcoffset" and
"tzname" return for both the crontab user as well as you as a user.

https://docs.python.org/3.8/library/datetime.html#datetime.timezone

Regards,
Rudy Wieser

Re: Time shift

<u6nbfv$1mtt8$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6506&group=comp.sys.raspberry-pi#6506

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: addr...@is.invalid (R.Wieser)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: Time shift
Date: Sun, 18 Jun 2023 18:30:45 +0200
Organization: A noiseless patient Spider
Lines: 34
Message-ID: <u6nbfv$1mtt8$1@dont-email.me>
References: <u6khd4$195qh$1@dont-email.me> <u6mbsm$1jqm6$1@dont-email.me> <u6micc$1kbtu$1@dont-email.me> <u6mrhk$1l8l6$1@dont-email.me> <u6msrv$1l8h8$3@dont-email.me> <u6n66g$1mb87$1@dont-email.me>
Injection-Date: Sun, 18 Jun 2023 16:30:55 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="93559f469530275023390ace770fa736";
logging-data="1800104"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Q0FVUDnO7yf6Ez00XxfVOn8wyH/U+RxGIjwvagtKY4Q=="
Cancel-Lock: sha1:M6teYWBg3J3brXFku0FpdkTErgg=
X-RFC2646: Format=Flowed; Response
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-MSMail-Priority: Normal
 by: R.Wieser - Sun, 18 Jun 2023 16:30 UTC

Dietmar,

> I don't think that there is a bug in the library.

Thats a good thought, as problems are seldom caused by bugs. More often its
just a simple misunderstanding something.

> Where the problem is .. getting crazy

I think you're going in the right direction. The only thing that needs to
be done is to verify it.

.... and even if not the right direction, trying to understand what happens
is /way/ better than directly trying to "work around" it (and there is a
good chance that the suggested work around would return the exact same
"wrong" result).

> The date at the commandline returnes the correct time.

Can you execute that thru the crontab and check (write to a file and compare
its timestamp with the date thats written into it) ? It would be another
confirmation of my assumption that the crontab account works with a
different timezone - or sould I say "works under UTC", as that is a good way
not to get into trouble with summer/winter time changes. But it bites you
in the a** when you're not aware of it - like now.

A quick DDG search for "linux crontab which timezone" returned the below :

https://stackoverflow.com/questions/13289751/cron-job-in-a-different-timezone

Regards,
Rudy Wieser

Re: Time shift

<20230618173350.cd2cc6dd98337e219936a176@eircom.net>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6507&group=comp.sys.raspberry-pi#6507

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ste...@eircom.net (Ahem A Rivet's Shot)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: Time shift
Date: Sun, 18 Jun 2023 17:33:50 +0100
Organization: A noiseless patient Spider
Lines: 15
Message-ID: <20230618173350.cd2cc6dd98337e219936a176@eircom.net>
References: <u6khd4$195qh$1@dont-email.me>
<u6mbsm$1jqm6$1@dont-email.me>
<u6micc$1kbtu$1@dont-email.me>
<u6mrhk$1l8l6$1@dont-email.me>
<u6n7rf$1mhbq$1@dont-email.me>
<u6naiv$1mr65$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="e91e135c262ebdebdb08bcfe2cc55440";
logging-data="1805005"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+TsTV5cLo/MnxynVH0egO/NRPvnDoke/E="
Cancel-Lock: sha1:WB9Uha9zvD3ma9cEhteein7cUMU=
X-Newsreader: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd13.1)
X-Clacks-Overhead: "GNU Terry Pratchett"
 by: Ahem A Rivet's - Sun, 18 Jun 2023 16:33 UTC

On Sun, 18 Jun 2023 18:15:06 +0200
"R.Wieser" <address@is.invalid> wrote:

> It looks like the different accounts (users) can have their own timezones.

This has been a standard feature of unix since timezone support
first appeared. It was not uncommon for multi-user systems with remote
access to have users in multiple timezones who naturally want to see their
own local time and not that of the machine room.

--
Steve O'Hara-Smith
Odds and Ends at http://www.sohara.org/
Host: Beautiful Theory meet Inconvenient Fact
Obit: Beautiful Theory died today of factual inconsistency

Re: Time shift

<u6nhbh$1ng6g$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6508&group=comp.sys.raspberry-pi#6508

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: addr...@is.invalid (R.Wieser)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: Time shift
Date: Sun, 18 Jun 2023 20:10:48 +0200
Organization: A noiseless patient Spider
Lines: 19
Message-ID: <u6nhbh$1ng6g$1@dont-email.me>
References: <u6khd4$195qh$1@dont-email.me><u6mbsm$1jqm6$1@dont-email.me><u6micc$1kbtu$1@dont-email.me><u6mrhk$1l8l6$1@dont-email.me><u6n7rf$1mhbq$1@dont-email.me><u6naiv$1mr65$1@dont-email.me> <20230618173350.cd2cc6dd98337e219936a176@eircom.net>
Injection-Date: Sun, 18 Jun 2023 18:10:57 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="93559f469530275023390ace770fa736";
logging-data="1818832"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+TAxaTBiGlXGTUKd0OriLwsd3EwND6lqdxc+VDeafNvA=="
Cancel-Lock: sha1:crPX1u55m7ZEKEjRh9ElXzdGQMY=
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-RFC2646: Format=Flowed; Original
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-Priority: 3
X-MSMail-Priority: Normal
 by: R.Wieser - Sun, 18 Jun 2023 18:10 UTC

Ahem,

> This has been a standard feature of unix since timezone support
> first appeared.

Thanks for the confirmation.

And it shows how little I actually know about Linux.

> It was not uncommon for multi-user systems with remote access to
> have users in multiple timezones who naturally want to see their
> own local time and not that of the machine room.

I already figured that that would be the logic behind having it. :-)

Regards,
Rudy Wieser

Re: Time shift

<u6nnad$1o5j3$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6509&group=comp.sys.raspberry-pi#6509

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dmysliwi...@web.de (Dietmar Mysliwietz)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: Time shift
Date: Sun, 18 Jun 2023 21:52:45 +0200
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <u6nnad$1o5j3$1@dont-email.me>
References: <u6khd4$195qh$1@dont-email.me> <u6mbsm$1jqm6$1@dont-email.me>
<u6micc$1kbtu$1@dont-email.me> <u6mrhk$1l8l6$1@dont-email.me>
<u6n7rf$1mhbq$1@dont-email.me> <u6naiv$1mr65$1@dont-email.me>
<20230618173350.cd2cc6dd98337e219936a176@eircom.net>
<u6nhbh$1ng6g$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 18 Jun 2023 19:52:45 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="2392f70fb90e1d99ba06176c38db8dc3";
logging-data="1840739"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+MVDLoPGl2NV1GlqXfFgzc"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.12.0
Cancel-Lock: sha1:FufAvjjbR5GQQsxdo8EywYUlD4U=
Content-Language: Deutsch - neue Rechtschreibung
In-Reply-To: <u6nhbh$1ng6g$1@dont-email.me>
 by: Dietmar Mysliwietz - Sun, 18 Jun 2023 19:52 UTC

Am 18.06.2023 um 20:10 schrieb R.Wieser:
> Ahem,
>
>> This has been a standard feature of unix since timezone support
>> first appeared.
>
> Thanks for the confirmation.
>
> And it shows how little I actually know about Linux.
>
>> It was not uncommon for multi-user systems with remote access to
>> have users in multiple timezones who naturally want to see their
>> own local time and not that of the machine room.
>
> I already figured that that would be the logic behind having it. :-)
>
> Regards,
> Rudy Wieser
>
>

Thanks again Rudy,

I will tray to figure it out tomorrow.

Thanks a lot to all others.

Have a good night.

Dietmar.

Re: Time shift

<qdWcnQcldOoM9RL5nZ2dnZfqnPednZ2d@brightview.co.uk>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6510&group=comp.sys.raspberry-pi#6510

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!feeder.usenetexpress.com!tr2.iad1.usenetexpress.com!69.80.99.27.MISMATCH!Xl.tags.giganews.com!local-2.nntp.ord.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail
NNTP-Posting-Date: Sun, 18 Jun 2023 20:26:57 +0000
Date: Sun, 18 Jun 2023 21:26:55 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0
From: me...@privacy.net (NY)
Subject: Re: Time shift
Newsgroups: comp.sys.raspberry-pi
References: <u6khd4$195qh$1@dont-email.me> <0kg3mj-p2lu.ln1@ardbeg.whisky.at.home> <u6n6dg$1mb87$2@dont-email.me>
Content-Language: en-GB
In-Reply-To: <u6n6dg$1mb87$2@dont-email.me>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Antivirus: AVG (VPS 230618-6, 18/6/2023), Outbound message
X-Antivirus-Status: Clean
Message-ID: <qdWcnQcldOoM9RL5nZ2dnZfqnPednZ2d@brightview.co.uk>
Lines: 44
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-8JPRVnBVHrjFmaPLMgcGZhYGtTv9IchJaA6VImg7O03uuQuGXF68aZLPzBajxjWAwVMbJ0sGiKYyh8J!TqoArlEjm/UUZNbF0h9y60uutGYeSlHgbYRK4T92qKByBTJWDIoGPOYwJUNyPu7OGZ2T8ZOAYD1m!7COkuy0f0EZi53TT2rc+p+Yg1GQ=
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
 by: NY - Sun, 18 Jun 2023 20:26 UTC

On 18/06/2023 16:04, Dietmar Mysliwietz wrote:
> Am 18.06.2023 um 16:23 schrieb Michael Schütz:
>> Dietmar Mysliwietz <dmysliwietz@web.de> schrieb:
>>> Hallo,
>>>
>>> I have a python-script which is called at 0 and 30 minutes at every hour
>>> from a cronjob:
>>>
>>>      0,30 * * * * sudo python3 /*****
>>>
>>> In the script I call the current time:
>>>
>>>      akdatum    = datetime.datetime.today()
>>>      akzeit     = akdatum.time()
>>>      akzeitstr  = akzeit.strftime('%H:%M')
>>>
>>> At 0 minutes the returned hour is one hour BEFORE the real hour.
>>> At 30 minutes the returned hour is the correct hour.
>>>
>>> Any ideas ?
>>>
>> Yeah, just an idea. Try in crontab
>>
>>     0,30 * * * * sudo { sleep 1; python3 /*****; } (or so)
>>
>>
>>> Thank you.
>>>
>>> Dietmar.
>>
>
> Thank you Michael,
>
> that doesn't help. There was a time delay from 10 seconds in the Python
> at the begin.

I'm puzzled by this. How about trying cron jobs started at xx:01, xx:02,
.... xx:58, xx:59 to see at what point the hour changes from being
incorrect to being correct.

I presume if you call your Python program manually (as opposed to from
cron) it gives the correct time even if you call it at xx:00:00.

Time shift

<1687125664@f1.n250.z2.fidonet.org>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6511&group=comp.sys.raspberry-pi#6511

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!rocksolid2!news.neodome.net!csiph.com!news.bbs.nz!.POSTED.agency.bbs.nz!not-for-mail
From: nospam.V...@f1.n250.z2.fidonet.org (Vincent Coen)
Newsgroups: comp.sys.raspberry-pi
Subject: Time shift
Date: Sun, 18 Jun 2023 22:48:06 +1300
Organization: Agency HUB, Dunedin - New Zealand
Message-ID: <1687125664@f1.n250.z2.fidonet.org>
References: <u6nnad$1o5j3$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Injection-Info: news.bbs.nz; posting-host="8IWYKlztXHa0+IViEdY46zrq8kpk7dC9fTbT74JiSDQ";
logging-data="1447"; mail-complaints-to="abuse@news.bbs.nz"
User-Agent: VSoup v1.2.9.47Beta [95/NT]
X-Comment-To: Dietmar Mysliwietz
X-MailConverter: SoupGate-Win32 v1.05
 by: Vincent Coen - Sun, 18 Jun 2023 09:48 UTC

Hello Dietmar!

Sunday June 18 2023 21:52, you wrote to All:

> Am 18.06.2023 um 20:10 schrieb R.Wieser:
>> Ahem,
>>
>>> This has been a standard feature of unix since timezone support
>>> first appeared.
>>
>> Thanks for the confirmation.
>>
>> And it shows how little I actually know about Linux.
>>
>>> It was not uncommon for multi-user systems with remote access to
>>> have users in multiple timezones who naturally want to see their
>>> own local time and not that of the machine room.
>>
>> I already figured that that would be the logic behind having it. :-)
>>
>> Regards,
>> Rudy Wieser
>>
>>

> Thanks again Rudy,

> I will tray to figure it out tomorrow.

> Thanks a lot to all others.

Question's for you:

1. What times do you have ntp or/and ntpdate running ?
2. If not ntp then what are you using to update the system clock ?
3. Confirm that system is on 24/7 AND on stable main power.
4. Assuming you are using ntp what is the result of running sudo ntpstat
For example the results of this for my system is :

synchronised to NTP server (85.199.214.98) at stratum 2
time correct to within 8 ms
polling server every 1024 s

Vincent

Re: Time shift

<u6p1qa$20ubn$3@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6512&group=comp.sys.raspberry-pi#6512

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: tnp...@invalid.invalid (The Natural Philosopher)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: Time shift
Date: Mon, 19 Jun 2023 08:58:02 +0100
Organization: A little, after lunch
Lines: 21
Message-ID: <u6p1qa$20ubn$3@dont-email.me>
References: <u6khd4$195qh$1@dont-email.me> <u6mbsm$1jqm6$1@dont-email.me>
<u6micc$1kbtu$1@dont-email.me> <u6mrhk$1l8l6$1@dont-email.me>
<u6msrv$1l8h8$3@dont-email.me> <u6n66g$1mb87$1@dont-email.me>
<u6nbfv$1mtt8$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 19 Jun 2023 07:58:02 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="d126b684298162d85afbd0617ea8f836";
logging-data="2128247"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18przBO1TxTQ69ap40T4nk3ztlMxaFl944="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:+oX2H+PsHnF/em3+xcWggA8xTNg=
Content-Language: en-GB
In-Reply-To: <u6nbfv$1mtt8$1@dont-email.me>
 by: The Natural Philosop - Mon, 19 Jun 2023 07:58 UTC

On 18/06/2023 17:30, R.Wieser wrote:
> Dietmar,
>
>> I don't think that there is a bug in the library.
>
> Thats a good thought, as problems are seldom caused by bugs. More often its
> just a simple misunderstanding something.
>
Perhaps I code at a different level but I have found several bugs in
PHP and/or javascript implementations.

Right at the edges of what is defined by the language

There is usually a workaround to avoid the case...

--
“The urge to save humanity is almost always only a false face for the
urge to rule it.”
– H. L. Mencken

Re: Time shift

<u6p6f1$21gha$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6513&group=comp.sys.raspberry-pi#6513

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: addr...@is.invalid (R.Wieser)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: Time shift
Date: Mon, 19 Jun 2023 11:17:10 +0200
Organization: A noiseless patient Spider
Lines: 34
Message-ID: <u6p6f1$21gha$1@dont-email.me>
References: <u6khd4$195qh$1@dont-email.me> <u6mbsm$1jqm6$1@dont-email.me> <u6micc$1kbtu$1@dont-email.me> <u6mrhk$1l8l6$1@dont-email.me> <u6msrv$1l8h8$3@dont-email.me> <u6n66g$1mb87$1@dont-email.me> <u6nbfv$1mtt8$1@dont-email.me> <u6p1qa$20ubn$3@dont-email.me>
Injection-Date: Mon, 19 Jun 2023 09:17:21 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="b87ba8c5eb38c36a94af09363aef98a4";
logging-data="2146858"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/KHTZZDfc2APwigMv8ZeETXpld5fkx3Av57SFaaJOZXQ=="
Cancel-Lock: sha1:Pv6im0MGZS5Wy/LDAs20n6m0i38=
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-MSMail-Priority: Normal
X-RFC2646: Format=Flowed; Response
X-Priority: 3
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
 by: R.Wieser - Mon, 19 Jun 2023 09:17 UTC

TNP,

> Perhaps I code at a different level but I have found several bugs in PHP
> and/or javascript implementations.

Not the same languages, but the same here. The most recent one not even a
week old. It doesn't make any difference to my statement.

In practice most "bugs" turn out to be a misunderstanding (of what gets
returned as a result of executing something). Assuming that everything
must be a bug of some sort is therefore quite counter productive.

And I did wonder how you could come up with a "work around" without even
having an idea of what the problem was. Depending on luck perhaps ?
Alas, it didn't work this time. :-)

> Right at the edges of what is defined by the language

Yep. A vague definition leaving it up to the implementer to make sense of
it often does that. Have multiple seperate parties make their own guesses
towards such a vague definition and you're in for a ball.

A prime example of that is how pure HTML webpages (no CSS or JS) display
different in the different browsers (and why some websites still display
"best viewed in ..." banners).

> There is usually a workaround to avoid the case...

There is seldom only one way to solve a problem.

Regards,
Rudy Wieser

Re: Time shift

<20230619114251.e11e36440d6ee36f6cb06d70@eircom.net>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6514&group=comp.sys.raspberry-pi#6514

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!rocksolid2!i2pn.org!news.chmurka.net!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ste...@eircom.net (Ahem A Rivet's Shot)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: Time shift
Date: Mon, 19 Jun 2023 11:42:51 +0100
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <20230619114251.e11e36440d6ee36f6cb06d70@eircom.net>
References: <u6khd4$195qh$1@dont-email.me>
<u6mbsm$1jqm6$1@dont-email.me>
<u6micc$1kbtu$1@dont-email.me>
<u6mrhk$1l8l6$1@dont-email.me>
<u6msrv$1l8h8$3@dont-email.me>
<u6n66g$1mb87$1@dont-email.me>
<u6nbfv$1mtt8$1@dont-email.me>
<u6p1qa$20ubn$3@dont-email.me>
<u6p6f1$21gha$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="69a8012839c3bfe0e2f6db25d67cde23";
logging-data="2167465"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+MvX3LqQ+ff0SUhRIVBaIsNoAbr37Pbyg="
Cancel-Lock: sha1:vzzoO3vALual4Hlys4IgpvuGvAs=
X-Clacks-Overhead: "GNU Terry Pratchett"
X-Newsreader: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd13.1)
 by: Ahem A Rivet's - Mon, 19 Jun 2023 10:42 UTC

On Mon, 19 Jun 2023 11:17:10 +0200
"R.Wieser" <address@is.invalid> wrote:

> A prime example of that is how pure HTML webpages (no CSS or JS) display
> different in the different browsers

That was the original intention with HTML and if the advertisers
who insisted on being able to have pixel for pixel matches to their designs
and been told to get stuffed from the beginning we might have escaped the
chaos of CSS and the difficulties of designing for multiple device types by
just leaving the layout to the browser as originally intended and *only*
providing semantic(ish) markup.

JavaScript seemed like a good idea originally - it has got well out
of hand - DOM interaction was a *BAD* idea.

--
Steve O'Hara-Smith
Odds and Ends at http://www.sohara.org/
Host: Beautiful Theory meet Inconvenient Fact
Obit: Beautiful Theory died today of factual inconsistency

Re: Time shift

<u6pi2c$22mmo$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6515&group=comp.sys.raspberry-pi#6515

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: addr...@is.invalid (R.Wieser)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: Time shift
Date: Mon, 19 Jun 2023 14:35:12 +0200
Organization: A noiseless patient Spider
Lines: 69
Message-ID: <u6pi2c$22mmo$1@dont-email.me>
References: <u6khd4$195qh$1@dont-email.me><u6mbsm$1jqm6$1@dont-email.me><u6micc$1kbtu$1@dont-email.me><u6mrhk$1l8l6$1@dont-email.me><u6msrv$1l8h8$3@dont-email.me><u6n66g$1mb87$1@dont-email.me><u6nbfv$1mtt8$1@dont-email.me><u6p1qa$20ubn$3@dont-email.me><u6p6f1$21gha$1@dont-email.me> <20230619114251.e11e36440d6ee36f6cb06d70@eircom.net>
Injection-Date: Mon, 19 Jun 2023 12:35:24 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="b87ba8c5eb38c36a94af09363aef98a4";
logging-data="2185944"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+H/cKBYoafvvoiiGAWiGN/mhy3FigsDTt2VkoytBBlbg=="
Cancel-Lock: sha1:XROV3rpG3JNOTDj9hfYnBEnUKNc=
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-RFC2646: Format=Flowed; Original
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
 by: R.Wieser - Mon, 19 Jun 2023 12:35 UTC

Ahem,

>> A prime example of that is how pure HTML webpages (no CSS or JS) display
>> different in the different browsers

....

> just leaving the layout to the browser as originally intended and *only*
> providing semantic(ish) markup That was the original intention with HTML

Yep.

Though my "different" was aimed at how the different browsers interpret and
"execute" the HTML page, not about formatting HTML as if its a PDF document.

You can still take two different browsers (read: HTML engines) and set their
widths to exactly the same, and you still stand a good chance that a simple
HTML-only document won't look the same on both.

IOW, although the definition of how the different HTML elements are supposed
to behave and is widely available, due to implementation differences the
output differs between browsers.

> JavaScript seemed like a good idea originally - it has got well out
> of hand - DOM interaction was a *BAD* idea.

It was. Just as atomic energy was. But alas, there are always people who
weaponise stuff like that.

Personally I've got JS permanently disabled. Because I've been taught that
running programs from unknown sources is never a good idea.

Ofcourse, knowing that most JS is used for advertisements doesn't really
help either. :-)

Regards,
Rudy Wieser

"Ahem A Rivet's Shot" <steveo@eircom.net> wrote in message
news:20230619114251.e11e36440d6ee36f6cb06d70@eircom.net...
> On Mon, 19 Jun 2023 11:17:10 +0200
> "R.Wieser" <address@is.invalid> wrote:
>
>> A prime example of that is how pure HTML webpages (no CSS or JS) display
>> different in the different browsers
>
> That was the original intention with HTML and if the advertisers
> who insisted on being able to have pixel for pixel matches to their
> designs
> and been told to get stuffed from the beginning we might have escaped the
> chaos of CSS and the difficulties of designing for multiple device types
> by
> just leaving the layout to the browser as originally intended and *only*
> providing semantic(ish) markup.
>
> JavaScript seemed like a good idea originally - it has got well out
> of hand - DOM interaction was a *BAD* idea.
>
> --
> Steve O'Hara-Smith
> Odds and Ends at http://www.sohara.org/
> Host: Beautiful Theory meet Inconvenient Fact
> Obit: Beautiful Theory died today of factual inconsistency

Re: Time shift

<u6pkqa$21sas$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=6516&group=comp.sys.raspberry-pi#6516

  copy link   Newsgroups: comp.sys.raspberry-pi
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Pancho.J...@proton.me (Pancho)
Newsgroups: comp.sys.raspberry-pi
Subject: Re: Time shift
Date: Mon, 19 Jun 2023 14:22:08 +0100
Organization: A noiseless patient Spider
Lines: 71
Message-ID: <u6pkqa$21sas$1@dont-email.me>
References: <u6khd4$195qh$1@dont-email.me> <u6mbsm$1jqm6$1@dont-email.me>
<u6micc$1kbtu$1@dont-email.me> <u6mrhk$1l8l6$1@dont-email.me>
<u6msrv$1l8h8$3@dont-email.me> <u6n66g$1mb87$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 19 Jun 2023 13:22:18 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="58cc0ee4f795951d692d4b352f89a0b9";
logging-data="2158940"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+gYn0kNVJ37j3kUE5hq5+0Tu6bSvXrKj4="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.9.1
Cancel-Lock: sha1:lZ4rDPDvmNLsLCINsGPO8X/R3R4=
In-Reply-To: <u6n66g$1mb87$1@dont-email.me>
Content-Language: en-GB
 by: Pancho - Mon, 19 Jun 2023 13:22 UTC

On 18/06/2023 16:00, Dietmar Mysliwietz wrote:
> Am 18.06.2023 um 14:21 schrieb The Natural Philosopher:
>> On 18/06/2023 12:58, Dietmar Mysliwietz wrote:
>>> Am 18.06.2023 um 11:22 schrieb R.Wieser:
>>>> Dietmar,
>>>>
>>>> "R.Wieser" <address@is.invalid> wrote in message
>>>> news:u6mbsm$1jqm6$1@dont-email.me...
>>>> ...
>>>>> Provide a bit more info
>>>>
>>>> You know, I currently do not even know what you are using that code
>>>> of yours
>>>> for (creating a time-stamped file ?) and/or how you determined that
>>>> the hour
>>>> is (sometimes) wrong.
>>>>
>>>> There is a chance you're misunderstanding what you are seeing, or
>>>> looking at
>>>> the wrong output.  But with the rather meager info you supplied
>>>> there is no
>>>> way for us to figure any such thing out.
>>>>
>>>> Which might well be why you have so few responses ...
>>>>
>>>> Regards,
>>>> Rudy Wieser
>>>>
>>>>
>>>
>>> Thank you Rudy,
>>>
>>> what I tried was, to wait a few seconds in the Python-script: no
>>> success.
>>>
>>> And I wrote in the Python-script the time values to a file. There are
>>> the wrong hours too. But the file has the correct timestamp. The RPi
>>> has timezone information (Europe/Berlin).
>>>
>> It wouldn't be the first time a language-supplied library had some
>> kind of bug in it.
>>
>> Not a great Python coder, but can you essentially execute the Linux
>> 'date' command and parse the output?
>>
>> I have to say I've used date time functions in 'C' and never had an
>> issue.
>>
>>> Now I try timezone information in the Python.
>>>
>>> Dietmar.
>>
>
> I don't think that there is a bug in the library. Where the problem is
> .. getting crazy
>
> The date at the commandline returnes the correct time.
>
> Dietmar.

I had a quick look and couldn't see where, or how, the value of
datetime.today() becomes aware of timezone. There is some twaddle about
"aware" and "naive" but I lost the will to live after seeing
"unambiguously".

As far as I can see, the only safe thing to do is to explicitly set the
datetime tzinfo attribute. All in all, it looks like poo, not uncommon
for datetime libraries.

Pages:12
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor