Thank you all for your responses!
On Tue, Jun 18, 2024 at 9:54 PM Jon Ribbens via Python-list
wrote:
>
> datetime.now(ZoneInfo("America/New_York")).isoformat()
Both .isoformat() and "%:z" work.
--
Tangra Mega Rock: http://www.radiotangra.com
--
https://mail.python.org/mailman/listinfo/python
Hello,
How can I convert a date, usually datetime.now(), into a format where
the timezone is in hours:minutes format. I was able to get that format
in shell:
$ date +%Y-%m-%dT%H:%M:%S%:z
2024-06-18T19:24:09-04:00
The closest I got in python is
from datetime import datetime
from zoneinfo import
On Mon, Mar 11, 2024 at 5:06 PM dn via Python-list
wrote:
>
> Good question Rambius!
>
> On 12/03/24 09:53, Ivan "Rambius" Ivanov via Python-list wrote:
> > Hello,
> >
> > I am refactoring some code and I would like to get rid of a global
> >
On Mon, Mar 11, 2024 at 5:01 PM Chris Angelico via Python-list
wrote:
>
> On Tue, 12 Mar 2024 at 07:54, Ivan "Rambius" Ivanov via Python-list
> wrote:
> > I am refactoring some code and I would like to get rid of a global
> > variable. Here is the outline:
> &
Hello,
I am refactoring some code and I would like to get rid of a global
variable. Here is the outline:
import subprocess
CACHE = {}
def lookup(key):
Runs the command cmd, parses its output, extract's the key's value,
caches it and returns it. If the key has already been in the cac