pytz Questions
3
As far as I can tell, I don't even need pytz for what I'm doing.
I'm re-learning python for image processing using the O'Reilly book 'Programming Computer Vision with Python' for work (and I'm als...
Abba asked 14/10, 2014 at 10:52
5
Solved
I'm using the pytz module to translate a date from America/Los_Angeles timezone to UTC using the code below:
TZ = 'America/Los_Angeles'
from = pytz.timezone(TZ)
utc = from.localize(original_date).a...
7
Solved
I created an hourly dates dataframe, and now I would like to create a column that flags whether each row (hour) is in Daylight Saving Time or not. For example, in summer hours, the flag should == 1...
Acquah asked 23/9, 2018 at 15:49
5
Solved
Specifically, given the timezone of my server (system time perspective) and a timezone input, how do I calculate the system time as if it were in that new timezone (regardless of daylight savings, ...
6
Solved
I'm trying to understand why I'm getting these results when converting time zones to UTC:
In [74]: d1 = datetime(2007, 12, 5, 6, 30,tzinfo=pytz.timezone('US/Pacific'))
In [75]: d1
Out[75]: datetime...
4
Solved
I would like to understand when I should be using
datetime.now(tz=pytz.utc).replace(tzinfo=None)
as opposed to simply
datetime.utcnow()
Will the latter not take into account e.g. daylight sa...
3
Solved
I'm having trouble understanding the conversion between the "Etc/GMT-5" timezone and UTC in pytz.
>>> dt = datetime(2009, 9, 9, 10, 0) # September 9 2009, 10:00
>>> gmt_5 = pytz....
16
Solved
What I need to do
I have a timezone-unaware datetime object, to which I need to add a time zone in order to be able to compare it with other timezone-aware datetime objects. I do not want to conver...
Trencherman asked 15/8, 2011 at 12:55
4
Solved
Ok let me first start by saying my timezone is CET/CEST. The exact moment it changes from CEST to CET (back from DST, which is GMT+2, to normal, which GMT+1, thus) is always the last Sunday of Octo...
Overton asked 18/7, 2013 at 20:21
2
Solved
I'm trying to convert a UTC time to the appropriate local time in a flask application. I'm wondering if I can detect the user's timezone and dynamically set it.
This is my code so far which works ...
7
Solved
I'm writing a lambda function that works with datetimes and trying to import pytz so I can have timezone be accounted for when comparing.
import boto3
import pytz
from datetime import timedelta, d...
Pullman asked 20/1, 2016 at 17:26
10
Solved
2
Solved
I am try creating a datetime object in python using datetime and pytz, the offset shown is wrong.
import datetime
from pytz import timezone
start = datetime.datetime(2011, 6, 20, 0, 0, 0, 0, time...
3
Solved
>>> import pytz
>>> pytz.timezone('Asia/Hong_Kong')
<DstTzInfo 'Asia/Hong_Kong' LMT+7:37:00 STD>
A seven hour and 37 minute offset? This is a little strange, does anyone e...
1
Solved
I want something like this:
from datetime import datetime, timezone
import pytz
def convert_datetime_by_timezone(timestamp_dt, to_timezone):
if isinstance(to_timezone, str):
return timestamp_dt...
3
Solved
I am trying to run a python async app with an asyncioscheduler scheduled job but the APScheduler fails during build because of this error:
'Only timezones from the pytz library are supported' erro...
Pasquinade asked 18/8, 2021 at 12:36
4
Solved
I am writing a simple function that sends messages based on a schedule using AsyncIOScheduler.
scheduler = AsyncIOScheduler()
scheduler.add_job(job, "cron", day_of_week="mon-fri"...
2
Solved
How would I get my python script to check whether or not a specific timezone that is stored in a variable using DST right now?
My server is set to UTC.
So I have
say for instance
zonename = Paci...
2
Solved
I would like to infer in Python if a date is the actual day of the year in which the hour is changed due to DST (Daylight Saving Time).
With the library pytz you can localize a datetime and the act...
9
Solved
I'm having a very weird problem with Python's pytz: it seems to have an incomplete catalog of timezones on my system (MacOS X 10.8.5, system Python 2.7.5).
>>> from pytz import timezone
&...
1
Solved
Intro: My project TIME_ZONE is equal to 'UTC' while I have users from too many time zones. So, when I user make POST or PUT with date or time or dateTime fields I convert these fields to UTC befor...
Surmise asked 17/7, 2021 at 6:56
5
Solved
Seems strange, but I cannot find an easy way to find the local timezone using pandas/pytz in Python.
I can do:
>>> pd.Timestamp('now', tz='utc').isoformat()
Out[47]: '2016-01-28T09:36:35.6...
Cerebrovascular asked 28/1, 2016 at 9:48
5
Solved
I'm modifying our pacific time zone filter to include a time option. I don't want the time component to be shown if midnight. The only import thus far we are using is dateutil.parser. Any pointers ...
3
Solved
TL;DR;
How to convert 2016-01-01 to Django timezone?
Full version:
I receive a query string parameter from a form and I wanna get that string and use it as a datetime filter in Django.
The prob...
1
I am trying to change the time zone in my project, depending on what the user has selected.
To do that I have a field in my database, where I keep all possible locations:
timezone = models.CharFi...
1 Next >
© 2022 - 2025 — McMap. All rights reserved.