Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
75 views

I use the following to write CSV lines in a loop while running sensor instrumentation, and I want to read them back in for post-processing without pandas. I would like to use the imported data to ...
onix's user avatar
  • 3
7 votes
2 answers
190 views

I am puzzled by an inconsistency when calling .strftime() for dates which are pre-1000 AD, using Python's datetime module. Take the following example: import datetime old_date = datetime.date(year=33, ...
Melipone's user avatar
  • 730
3 votes
1 answer
81 views

I'm attempting to parse HTML time strings in Python: from datetime import datetime input = "2025-03-24T07:01:53+00:00" output = datetime.strptime(input, "%Y-%m-%d%X%:z") print(...
The-Coder-Who-Knew-Too-Little's user avatar
0 votes
0 answers
83 views

I am trying to use pyqtgraphs DateAxisItem for relative times on the x axis, i.e., durations (which can be between a few hours and several days). I know I could simply use an ordinary AxisItem and ...
emma's user avatar
  • 337
2 votes
2 answers
154 views

I am trying to determine whether a given date string includes all three components: day, month, and year. Example Inputs and Expected Outputs: "2025-01-01" → True (All components are ...
Chinmai Veera's user avatar
0 votes
1 answer
112 views

When I use .shift() from Pandas on a column in a DataFrame with a date index, I can use it, for example, with .corr(), but I cannot update my old DataFrame or create a new one. Dataset My df looks ...
Mihuu's user avatar
  • 1
-1 votes
1 answer
349 views

I have a df datetime column that I want to convert from Europe/Copenhgaen t.z to UTC but I just keep getting duplicate entries in the UTC column. The reason this happens is because of how I make my ...
Tom's user avatar
  • 115
0 votes
1 answer
58 views

I'm connecting to an API that returns a list of articles, each article has created_at and modified_at properties. I want to return the difference (in hours) between the created_at and modified_at ...
Katie's user avatar
  • 9
2 votes
1 answer
817 views

I'm trying to format a datetime object in Python using either the strftime method or an f-string. I would like to include the time zone offset from UTC with a colon between the hour and minute. ...
E_Cross's user avatar
  • 43
0 votes
2 answers
62 views

In python 3.9: datetime.datetime respects tzinfo but datetime.time does not appear to. import datetime from zoneinfo import ZoneInfo dta = datetime.datetime.now(tz=ZoneInfo("America/Los_Angeles&...
Nmhor Kmhor's user avatar
2 votes
0 answers
93 views

In python I like the datetime module of the standard library to parse timestamps. However, some of the format codes depend on the locale set for the machine where it's run, which makes the code ...
Thrastylon's user avatar
  • 1,000
0 votes
3 answers
90 views

I am trying to parse a date string like this: import datetime document_updated_on = '01-Feb-2024#15:22 WET' format_str = "%d-%b-%Y#%H:%M %Z" updated_on_date = datetime.datetime.strptime(...
Tino's user avatar
  • 65
0 votes
0 answers
176 views

The time_machine module in python keeps setting a time that is one day earlier than the date that I set. I must be missing something obvious! Here's an example of a simple program showing the ...
l'anonyme's user avatar
0 votes
1 answer
73 views

I have data on frequencies (N), for combinations of [from, to, subset], and the month. Importantly, when N=0, the row is missing. N from to subset month ...
FooBar's user avatar
  • 16.7k
0 votes
1 answer
53 views

I have a folder directory (shown below) that contains folders titled "year-month." They will be continuously added over time. I am trying to write a python code that selects any files in ...
George Bunkall's user avatar
1 vote
2 answers
215 views

I am working with a set of monthly averaged time-series data that spans 20+ years and have put the data into a pandas dataframe. The index of the dataframe is composed of the datetime objects that ...
jrmact's user avatar
  • 23
0 votes
1 answer
361 views

I would like to ask for little support. I have here a python frame containing data giving in UTC format. I would like to transform the column into date-format. Order Date 15-Feb-2024 UTC 17-Feb-2024 ...
SMS's user avatar
  • 402
3 votes
1 answer
79 views

With a dataframe that has a datetime index, I am used to getting data for quarters with the syntax eg. df.loc["2014-Q1"] to grab the data for the first quarter of 2014 (Jan, Feb, Mar). This ...
Someone1348's user avatar
0 votes
1 answer
58 views

For testing purposes, I have deployed the following Firebase Cloud Function. When the function gets called, it adds a document to my Firestore collection with two fields containing two datetimes. @...
jaakdentrekhaak's user avatar
3 votes
1 answer
2k views

I need the current timestamp in EST but the current_timestamp() is returning PST. Tried the following code but it's not working and showing 6 hours before EST time: # Import the current_timestamp ...
newbie's user avatar
  • 55
-1 votes
1 answer
65 views

I was trying to caltculate the date using datetime module, but when I entered 1 in define dates it showed me: 41 days, 0:00:00 Traceback (most recent call last): File "", line 22, in <...
Ptalemon's user avatar
0 votes
0 answers
33 views

ValueError: time data "44033" doesn't match format "%d/%m/%Y", at position 0. You might want to try: - passing format if your strings have a consistent format; - passing format='...
Akshat Poladia's user avatar
7 votes
2 answers
2k views

I am running a script that uses pd.to_datetime() on inputs that are sometime not able to be parsed. For example if I try to run pd.to_datetime('yesterday') it results to an error DateParseError: ...
kosnik's user avatar
  • 2,474
0 votes
1 answer
153 views

I am trying to get the local time without the application of daylight savings time. I know that I can get the local time with the following, but when my location is in DST I get an extra hour. I want ...
orsapihki wiioiv's user avatar
0 votes
1 answer
704 views

Hi im new in programming in python with datetime (and in general to be honest). So im doing a project where I need to check if the user is more than 18 years old. I used timedelta to get the ...
BrunoRoda's user avatar

1
2 3 4 5
39