71,479 questions
-2
votes
0
answers
67
views
Unable to get the correct year for a UTC timestamp [closed]
I am trying to get a year, and time in UTC format for a particular time
I am able to print the time in the desired format but it is always printing wrong year , not sure if it prints the correct time ...
0
votes
1
answer
60
views
Converting object to string in pandas [closed]
Hi I am new to learning data science and was just trying to play with a data set:
When I check the dtype of a column it shows as object. I want to convert it to a string so I can strip the components ...
2
votes
4
answers
189
views
Flag rows if the time in a column falls within a specified window of another column
I have a dataframe where each row represents a detection of a fish. The fish can be either, Brown Trout (Fish.ID starts with TB_) or Salmon/Parr (Fish.ID starts with TA_). I want to create a new ...
1
vote
1
answer
37
views
TypeError: can't compare datetime.datetime to str when filtering data in Python [duplicate]
I have a list of records where each item has a date field. I'm trying to filter the records based on a given date:
from datetime import datetime
records = [
{"name": "John", &...
4
votes
1
answer
128
views
Python datetime and timedelta behaviour over Daylight savings time change
I encountered this behaviour and I figured I would ask the correct way to go about it.
Here is a toy example:
pre_timechange = datetime.datetime(2025, 11, 2, 1, 59, 9, tzinfo=zoneinfo.ZoneInfo(key='...
-2
votes
1
answer
60
views
Timedelta Unit Argument as a Variable [duplicate]
Is it possible to have the units argument for the timedelta function be defined by a variable?
To elaborate, is this possible?
Time_Unit = "days"
Time_Increment = 1
Time2 = Time1 + ...
4
votes
2
answers
108
views
Django difference between aware datetimes across DST [duplicate]
I'm working on a Django application in which I need to calculate the difference between timestamps stored in the DB. This week I run into some problems related to DST.
In particular in the following ...
0
votes
1
answer
116
views
How can I retrieve data between certain times?
My data decoded from a radio receiver is stored in tables Flights and Aircraft with a common field AircraftID to enable a JOIN. There are fields for when the radio signal starts and ends (StartTime ...
0
votes
1
answer
104
views
Combining two dataframes and keeping the average
I'm new to coding, and I'm trying to combine the data from two weather stations into one new dataframe sorted by Datetime. I want this new dataframe to contain the average values of the two original ...
3
votes
1
answer
136
views
GraalVM native-image localized data/time data
Given this sample:
final var ARABIC_GREGORIAN_DATE_FORMATTER = DateTimeFormatter.ofPattern("EEEE dd\\MM\\yyyy G").localizedBy(Locale.forLanguageTag("ar"));
final var ...
3
votes
3
answers
157
views
Calculating monthly revenue given start and end date for each ID using Polars
I have a dataframe using this format
import polars as pl
df = pl.from_repr("""
┌─────┬────────────┬────────────┬──────────┐
│ ID ┆ DATE_PREV ┆ DATE ┆ REV_DIFF │
│ --- ┆ --- ...
-2
votes
1
answer
145
views
How to display local time from a UTC time [closed]
I have some data with date time in UTC. My local time is usually 5 or 6 hours behind depending on standard or daylight time. I would like to print the local time.
Is there an easy way to do that in ...
0
votes
2
answers
84
views
How to get the current UTC date in Python as a type of datetime.datetime
I would like to use the Python standard library datetime to assign to a variable the current date, in UTC and having it of type datetime.datetime.
i.e. datetime.datetime(2025, 9, 23, 0, 0, tzinfo=...
2
votes
1
answer
84
views
Why does ngbDate picker Month & Date selection not come in Angular version 20?
I'm using Angular version 20. Month and year selection are missing. I have tried more methods, however I am still facing issues.
Imports:
CommonModule, FormsModule, ReactiveFormsModule, ...
2
votes
1
answer
170
views
Memory efficient sorting/removing duplicates of polars dataframes
I am trying to import very large csv files into parquet files using polars. I stream data, use lazy dataframes and sinks. No problem until...
...sorting the dataframe on a column and removing ...
1
vote
0
answers
30
views
Laravel 12: Run scheduled command at 07:00 UK time while server is on UTC
I’m using Laravel 12 and I want to run a scheduled command every day at 07:00 UK (Europe/London) time, but my server is configured with UTC timezone.
In my bootstrap/app.php I have and its working:
$...
4
votes
1
answer
413
views
Python 3.13.5 sqlite3 DeprecationWarning persists despite registering custom date adapter
I am building an application using Python 3.13.5 and the native sqlite3 library. To correctly handle datetime.date objects and avoid the new DeprecationWarning, I am trying to implement the officially ...
7
votes
2
answers
177
views
How to convert std::chrono::system_clock::now() to boost::mysql::datetime::time_point
I'm using the boost mysql library in a project. I need to use boost::mysql::datetime (datetime) to represent timestamps. A datetime value can be constructed from a boost::mysql::datetime::time_point.
...
2
votes
1
answer
138
views
What is NaT in Pandas?
I have a dataframe with some "NaT" values in a datetime column. What does that mean?
project status completed
0 windows done 2025-08-20
1 doors done 2025-08-21
2 hvac ...
2
votes
0
answers
77
views
how to implement a ConversionService from LocalDateTime to String in spring boot
I have a spring boot webapp, which uses thymeleaf for html templating and as templating engine for emails sent by this webapp, too. In my email I want to use a LocalDateTime, which does not work.
...
4
votes
1
answer
228
views
How to compare datetime.now() with sunrise/sunset times from Sunrise-Sunset API in Python?
I'm working on a Python script that checks whether it's currently dark outside based on my location (Barishal, Bangladesh). I use the Sunrise-Sunset API to get sunrise and sunset times, and then ...
1
vote
0
answers
350
views
Polars schema_override for Datetimes as string
Issue
I have data in form of a list of dicts (see MRE below). To make everything type strict I would always like to pass in the expected schema (dtypes) when I read in this data. This option is given ...
0
votes
2
answers
81
views
False output with datetime week and isocalendar() [closed]
I have this GUI with the button "get dates for last week".
I programmed this in 2024, using datetime objects and the isocalendar() method - and the button worked like a charm, returning the ...
1
vote
1
answer
125
views
Numpy Bug in computing business days?
I am trying to compute business days using Numpy.
I how ever found an inconsistency.
import numpy as np
# Count from 1st Jan 2023 to 31st Jan 2023
print("Jan: {0}".format(np.busday_count('...
3
votes
1
answer
97
views
Pandas create date time column based on other column with relative milliseconds time
My original data csv file columns looks like this:
| Millisec_diff | Value1 | Value2 |
| ------------- | ------ | ------ |
| 0 | 100 | 200 |
| 0.005 | 101 | 20.1 |
| 0....