Re: Timezone in HH:MM Format

2024-06-18 Thread Ivan "Rambius" Ivanov via Python-list
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

Re: Timezone in HH:MM Format

2024-06-18 Thread Jon Ribbens via Python-list
On 2024-06-18, Ivan "Rambius" Ivanov wrote: > 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

Re: Timezone in HH:MM Format

2024-06-18 Thread MRAB via Python-list
On 2024-06-19 00:32, Ivan "Rambius" Ivanov via Python-list wrote: 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 g

Timezone in HH:MM Format

2024-06-18 Thread Ivan "Rambius" Ivanov via Python-list
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