71,304
questions
0
votes
0
answers
13
views
How to query a clickhouse table for a given timestamp in python?
Using clickhouse-connect I am querying a table to get a timestamp:
import clickhouse_connect
client = clickhouse_connect.get_client(
host=CLICKHOUSE_CLOUD_HOSTNAME,
username=...
-1
votes
1
answer
40
views
Date Format with PHP using Datetime
I have two dates I need to show it in format
29th and 30th November 2024
or
28th to 30th November 2024
or
28th October to 30th November 2024
or
30th November and 1st December2024
What I tried so for ...
0
votes
0
answers
21
views
Is there a way to represent time deltas in Python that differentiates between "1 day" and "24 hours"? [duplicate]
I'm currently working on a reminder bot project that supports recurring reminders. For example, a user can specify that they want their reminder to repeat in intervals of "3 days", "12 ...
0
votes
0
answers
33
views
DateTime is switching Day and Month [duplicate]
I have a swagger page with an endpoint that has a DateTime as query parameter string($date-time).
All date formats seems to be ok but if I pass this format:
10/12/2024 (Day/Month/Year) it switches Day ...
1
vote
1
answer
80
views
Handling Overlapped Time Periods
I have 4 different time periods, a, b, c, and d.
a overlaps with b
b overlaps with c
a and c do not overlap
d does not overlap with a, b or c
However, I'd like to be able to chain these all into a ...
-2
votes
0
answers
49
views
Should I always store dates in UTC in the database? [closed]
I have read number of articles and stackoverflow questions and answers on this topic of what type of date should we store in the database.
The crux of which I got is that we should store date time as ...
2
votes
1
answer
41
views
Efficiently calculate an availability date from a list of project assignments and known capacity
I'm looking for an efficient way to calculate the date each member of a team is available given a set of project assignments. There are 25 team members, each with a set of capacities and assignments.
...
1
vote
0
answers
27
views
How to get the date difference between two jalali date (persianDatepicker) on clicking the second input date picker?
I use this https://github.com/behzadi/persianDatepicker script to show jalali date
I select date1 and date2 to from datepicker to my input
Code
$(document).ready(function() {
$('.example')....
0
votes
1
answer
47
views
How can you display the time and date in Zig?
How can you display the time and date in Sun Sep 15 10:01:02 AM CEST 2024 format in Zig?
PS: just started learn Zig
1
vote
0
answers
42
views
Possible faulty python datetime/pytz module behaviour [duplicate]
I think there may be a problem with the pytz/datetime module in python. Either that or I am not using it correctly.
Please look at the coding below which highlights the issues I'm currently facing. I'...
-1
votes
0
answers
60
views
I do not understand why mysql trigger is not working
I am trying to update a column named 'patient_los' by putting date difference of two columns i.e. 'ward_date' and 'discharge_date'. And this only happens when 'discharge_date' is change from null ...
-1
votes
0
answers
38
views
Return rows between entries of a datetimeindex
I'd like to return all rows from a dataframe, tos, for 5 minute intervals.
To start, I'm simply looping to allow space for processing the collected rows, but not opposed to vectorizing if it makes ...
1
vote
0
answers
74
views
How to use FakeTimeProvider to test blocking code?
My code does actually poll until a certain state is reached, like this:
using Microsoft.Extensions.Time.Testing;
namespace TestFramework.Tests.Integration
{
public class Tests
{
...
0
votes
0
answers
21
views
Date input widget
I am writing code in typescript angular for date input widget.
In this I am not able to modify date and month once I entered full date. Tried so much things but still not able to implement.
There are ...
0
votes
1
answer
25
views
How to calculate difference between dates by group in SAS
I have data that resembles the below, and need to calculate the average time (in months) between dates in the Event_date column, grouped by Subject_ID. In other words, for each subject in the data, I ...
0
votes
1
answer
35
views
RSpec error with expecting DateTime value to be_within a duration of a ActiveSupport::TimeWithZone value
Why does the following test give me a TypeError: expected numeric error:
it { expect(DateTime.now).to be_within(1.second).of Time.zone.now }
but this test does not?
it { expect(DateTime.now).to ...
-1
votes
3
answers
58
views
How to extract convert date in written text to numeric
I've a problem where I from a product description need to convert the months of the description to a billing period. Example description:
Transaction packages 2500 transactions / year included (JUNE-...
0
votes
2
answers
51
views
php time round up & round down
I am using the following function to round the time to closest 15 minutes.
function roundTime($time){
$seconds = $time;
$rounded_seconds = round($seconds / (15 * 60)) * (15 * 60);
return ...
0
votes
1
answer
48
views
php DateTime no formatting correctly [closed]
I have variable of a time (stored in db as CHAR(8), because when stored as TIME throws object error) which I am trying to format and also use to calculate difference with another time.
In this example,...
0
votes
1
answer
36
views
How can I stop pandas from plotting weekend dates for 5T frequency data when there is no weekend data? [duplicate]
I have the following 5-minute frequency time series data for weekdays only:
start_date = '2024-09-06 00:00:00'
end_date = '2024-09-10 00:00:00'
dt_index = pd.date_range(start=start_date, end=end_date, ...
-3
votes
1
answer
50
views
Sum up Week to Date values in a versatile manner - Pandas
So every day I have to pull a report that gets data for yesterday's metrics, forecasted Saturday's metrics, and Week to date sums.
I want to write a Python code that automates the process.
I have most ...
0
votes
2
answers
98
views
Clocktimes between 1:00:00 and 2:00:00
apologies for the Google translation I am using.
I can't seem to solve the following problem.
I am using the code below in VS2022 to control my aquarium via the serial port and an Arduino Mega.
The ...
0
votes
2
answers
41
views
Offset value and timezone is different in angular
I am working with angular project and need to send correct date and time to the server.
First, I have taken the offset by using below code
let offset=new Date().getTimezoneOffset();
let datestring=&...
0
votes
1
answer
27
views
finding an event schedule given the duration and possible timeslots
I am trying to find or wondering if you know about an algorithm that could be used in a specific event scheduling task:
given a list of events e with length Ne where each event has:
a duration d (in ...
2
votes
1
answer
57
views
How to substract amount of minutes in Pandas DataFrame datetime with condition?
I have a DataFrame like this (date: datetime64[ns], v: float64)
date v
2024-09-01 22:09:55 1.2
2024-09-01 22:12:08 1.11
2024-09-01 22:59:59 1.7
2024-09-01 23:00:02 1.1
...
0
votes
0
answers
39
views
Datetime picker in vuetify vuejs
We are using vuetify for our vuejs website.
We are able to integrate TimePicker and DatePicker in our project.
User has to click twice to choose datetime. Is there any way to choose both in a single ...
-1
votes
1
answer
43
views
How to go from human readable date format ('YYYY-MM-DD') to datetime format string ("%Y-%m-%d")
I would like to allow the user to specify the date format using a human readable format like 'YYYY-MM-DD'. But then I need to actually parse dates so I need the corresponding actual datetime format '%...
-2
votes
1
answer
53
views
Why is new Date() giving wrong date for other time zone users? [duplicate]
I have a hotel booking website. When users who are residing in India and have IST time zone try to book a hotel then the date they're seeing is correct. But when users who are outside IST time zone (...
0
votes
0
answers
37
views
TUniQuery replacing spaces with question marks. The spaces come from calls to TimeToStr(MyTTimeVar). It only happens on 64bit Android. Why?
I have the following code:
var Date: TDate := now;
var Time: TTime := now;
...
var Text: string := trim(DateToStr(Date)) + '|' + trim(TimeToStr(Time));
UniQuery1.FieldByName('BATCH DATA').AsString := ...
10
votes
3
answers
519
views
DateTime.ParseExact returns today if date string and format are set to "General"
During troubleshooting, I came across this weird behaviour which occurs when parsing text to create a DateTime object in C# (in .Net Core 8.0).
Can anybody explain why the following statements return ...
0
votes
0
answers
80
views
Converting a potential DST datetime to "normal" time when DST ends
I'm implementing conversion functions to and from DST datetimes. I have knowledge of when DST starts and ends. Going from "normal" time to DST is easy enough. Just add an hour to the normal ...
0
votes
1
answer
123
views
Display UTC time in local time with timezone
I'm attempting to display some UTC time in ISO format (2024-09-05T00:00:00), as local time (2024-09-05T09:00:00+0900). It's been challenging to achieve this in an elegant way, ideally only using ...
0
votes
1
answer
50
views
Converting datetime from chr to datetime format using POSIXct function in R
I am learning to code in R and currently doing the Bellabeat Google Data Analytics Capstone project. For this, I need to transform a column with datetime values (i.e. 4/12/2016 12:00:00 AM) formatted ...
0
votes
0
answers
55
views
pandas timezones conversion malfunction
Trying to build an algorithm for processing stocks. I'm not a dev, so basically my knowledge is limited.
I'm retrieving findata with an API. Looks like it's done correctly, sorted ascending. First ...
2
votes
1
answer
78
views
Efficient Conversion of Timezone-Aware Timestamps to datetime64[m] in Pandas
I have the following code that creates a DataFrame representing the data I have in my system:
import pandas as pd
data = {
"date": [
"2021-03-12 19:50:00-05:00", "...
0
votes
0
answers
42
views
Calculate week based on Settings [duplicate]
We have configuration in system where Admin can set Start month of Year and Start Day of the week.
Based on this , I need to calculate the Week and Month the Date falls in that Year.
Ex: If start ...
-2
votes
1
answer
49
views
PHP returns wrong timestamp for DateTimeImmutable object with the time zone set
I want to record a timestamp for a date which has a time zone.
I'd like to use PHP and the DateTimeImmutable object to do it. Unfortunately, It seems to be off by 1 hour, even though I think I set the ...
0
votes
1
answer
58
views
How to Save UTC DateTime in SQL Server with 'Z' Suffix or UTC Offset for Accurate Frontend Conversion
I have a DateTime variable with the value 2024-08-12T18:30:00, which is in UTC. While inserting this value into SQL Server, I want to ensure it retains the UTC designation. Specifically, I'd like the ...
0
votes
1
answer
41
views
working with dates and Calendar: need community help to improve sheet's efficiency
I am working with a sheet that handles commodities' future data (financial data, almost like stock data, but with monthly expiration dates that can go up to two to three years into the future).
My ...
0
votes
1
answer
92
views
How to extract date from a column in Pandas?
I am trying to extract only dates from a column(Result) of a dataframe. Dates will only start from year 2000 and beyond but the format of date could be any including datetime.
What I want is just date....
1
vote
2
answers
100
views
Add X days to a Datetime Series
I have a Datetime Series that always contains the datetime of yesterday like:
Series: '' [datetime[ns]]
[
2024-08-29 00:00:00
]
How can I add 2 days to that Datetime Series so that I can add the ...
0
votes
1
answer
39
views
Luxon DateTime not recognized as Luxon DateTime object
I am not understanding how Luxon works...
I am using Redux Toolkit. I initialize the state like this
import {DateTime} from "luxon"
interface TestStateProps {
startDate: DateTime,
...
5
votes
5
answers
85
views
Time difference in every n/two rows
I have this dataset
library(dplyr)
# creating a dataframe
data_frame <- data.frame(id = c(1,1,2,2,3,3),
col2 = c("start", "finish", "start", &...
0
votes
1
answer
85
views
Datetime in C# backend are losing timezone
I am creating a task in react frontend and it has some date fields. when I created a task I see the post call and the date fields showing in the post call as 2024-08-12T18:30:00.000Z now I am opening ...
0
votes
0
answers
33
views
EfCore+MySQL how to query DateTime that has been converted with ToBinary
The DbContext has been configured to convert DateTime objects as such:
protected override void ConfigureConventions(ModelConfigurationBuilder configurationBuilder) {
configurationBuilder.Properties&...
1
vote
0
answers
51
views
How can I fix random time offset in Windows Server 2016 without rebooting?
6 of our servers (which unfortunately are lots) changed their OS time at random (different) times by also random and different amounts for each of them. Time as well as date were changed by a maximum ...
0
votes
1
answer
64
views
Date-Querying A View v/s Same in Table [Azure Synapse DB]
I have an Azure Synapse DB that contains a view VW_REF_DATES. This view contains a column called c_date of type datetime2(0)
I want to be able to query this view with a Date condition in the WHERE ...
0
votes
0
answers
14
views
How to vectorize rolling average using datetime not fixed window
I have a dataframe of stock prices for around 5 years indexed on datetime that I need to get the 1 year and 6 month rolling Z score. A fixed window number for .rolling will be slightly off won't give ...
0
votes
1
answer
98
views
Python library sportsreference error: unsupported operand type(s) for +=: 'datetime.date' and 'int'
I am using google collab here with the sportsreference python library and pandas
The goal here is to collect NFL boxscores data from the past 25 years from sportsreference.com and return all the data ...
0
votes
1
answer
48
views
Visual Studio 2022 httpfile localDatetime is sending UTC time
I am building a web API that should be able to receive POST requests containing user messages. I have a .http file that should send a request to test this interface. One of the fields that it should ...