461 questions
3
votes
3
answers
96
views
Find Days Difference between two UK dates in vba userform
These dates are produced by Trevor Eyre's calendar in USA format so I have converted to UK for my users. However I guess that is why I can't find date difference as no longer a number. Is there a way?
...
0
votes
2
answers
60
views
Loop through unique id using difference between dates and time reset in R to obtain unique events [closed]
I have a df in R with multiple events per individual. Each event is currently defined by a unique date. The column diff_earliest_date is the number of days between the earliest date (by unique id) and ...
0
votes
1
answer
30
views
Difference between two variables from different dates
Using Crystal Reports
I want to be able to get the difference from the last date of the year and the first date of the year for each year of units. Group1 is for parameters only. Group2 is the unit ...
0
votes
1
answer
113
views
Application.DateDifference gives zero result on MSProject 2024
I'm having a problem calculating date differences in MS Project. For some reason I can't figure out, when I run the code on my machine (Project v2108), Application.DateDifference calculates just fine. ...
0
votes
2
answers
270
views
Snowflake task to remove records older than 14 days not including weekend days
I have created a table 'target_table' to hold daily snapshot of a source table. This target_table is updated via a task that inserts a snapshot of the source table every day and adds/assigns the date ...
-1
votes
1
answer
62
views
MS Access - Data difference calculation in Calculated field
In MS Access, I want to calculate "Aging" by using the today's date and Closed Date. Datediff is not heling, any pointers
I tried Datediff (Not allowed). Also could not get Today dates, if i ...
0
votes
1
answer
403
views
Calculate years, months, and days between now and an Excel datetime stamp in the past
How do you calculate years, months, and days between now and an Excel datetime stamp in the past.
For example, cell A1 contains "12/14/2022 12:08:35".
Cell B1 should contain "1 years 5 ...
2
votes
2
answers
349
views
PHP equivalent for MySQL's DATEDIFF
I have a problem with date comparing logic in MySQL and PHP: date difference functions return different results for the same dates. Example:
SQL
SELECT DATEDIFF('2024-06-02', '2024-05-03 12:57')
30
...
1
vote
1
answer
157
views
Why do I get a difference between two dates in Java? [duplicate]
Period period = new Period(startDate, endDate, PeriodType.yearMonthDay());
int years = period.getYears();
int months = period.getMonths();
int days = period.getDays();
if startDate = May 1, 1975 and ...
0
votes
0
answers
776
views
Convert months (in decimal form) to months and days that were found between two dates
UPDATE - My initial question has been answered. Follow up question at the bottom.
I'm trying to find the days, months, weeks, years between two dates (today and list of birthdays).
I couldn't find the ...
0
votes
0
answers
455
views
Excel: how do I use =datedif with conditional formatting to highlight date cells in a table?
I'm having a bad brain day and I just can't figure this out, lol.
I have two columns in a table, F and G, that contain dates (in date format). I want to use conditional formatting such that when I ...
4
votes
2
answers
94
views
Python Pandas filter rows by days of difference in two columns with weekend and holidays
I have a dataframe with two dates, among other things. I need to filter out rows that have more than two working days difference between these two dates. I must take into consideration weekends and ...
4
votes
1
answer
5k
views
Kotlin difference between two LocalDateTime
I have two kotlinx.datetime.LocalDateTime instances:
val startDate =
LocalDateTime(year = 2020, month = Month.MARCH, dayOfMonth = 25, hour = 10, minute =
36, second = 12)
val endDate =
LocalDateTime(...
0
votes
1
answer
143
views
Groovy script to break payload for every date between start and end dates [closed]
I have an input like this:
<root>
<results>
<loc>Loc 10</loc>
<loc_name>Loc Desc10</loc_name>
<points>3</points>
<StartDate>2023-...
0
votes
3
answers
161
views
using date for calender as an input to figure out the time difference
I have the following code and trying to figure out if the date difference is greater than one year or not. If I have the two dates like this:
2022-08-20 10:26:44.000
2023-08-25 10:26:44.000
How ...
1
vote
1
answer
168
views
Time duration between 2 DateTime columns EXCLUDE out of office hours - SQL BigQuery
I have a task requiring tracking SLA times. The aim is to exclude out of hours time from the total SLA time to get a true/fair SLA time.
Parameters:
Working hours for tasks are between 08:00:00 and ...
0
votes
1
answer
113
views
What is the Google Sheets formula to calculate the working hours for each specific day based on the source of the chat and the given work schedule?
With the condition:
Source Parameters Start Work End Work
Chat Monday - Friday 8:00 - 21:00
Email Monday - Friday 9:00 - 18:00
Chat and Email ...
1
vote
1
answer
2k
views
PRESTO: Calculating Date Difference Excluding Days: Precision in Months and Handling Greater Than 1 Month Condition
Question: I'm facing an issue while trying to calculate the difference between two dates in months, excluding the days. Here's the scenario:
WITH dates AS (
SELECT CAST('2000-03-01 00:00:00' AS ...
0
votes
1
answer
183
views
What is the Google sheets formula to calculate the working hours of timestamp difference for a specific working hours?
With the condition:
The working hours from Monday to Sunday from 09:00 - 18:00
Full holiday (no working) only on public holiday such as January 1, May 1, December 25
A. Ticket received on Sunday, ...
0
votes
0
answers
85
views
Check if EMIDate of next record is less than or equal to EMIdate of previous record, also calculate the Difference between 2 dates
Table #temp has columns AccountID, LoanSeries, InstNo, EMIDATE.
Each AccountID might have 1 or 2 LoanSeries, and each loanseries has min 30 InstNo, each InstNo has Increasing EMIDATE.
I need to find ...
-1
votes
1
answer
179
views
Get a list of months, according to financial year
Lets assume we had started a new vertical in Jan 2020, so according to the vertical's calendar Jan is 1st month, Feb = 2.. Dec = 12 & Jan 2021 = 13th month. Our vertical's financial calendar ...
-1
votes
1
answer
139
views
Google Sheets Automate Days Calculation for different Buy Date and Sell Date
I have a google sheet where Column A has Buy Date and Column L has Sell Date. Column B to K has several other data. There are multiple buys on different dates but selling is on a single date.
What I ...
-1
votes
1
answer
92
views
How to handle null values in date field in sql pgadmin
I need to find difference between two dates to calculate "total storage days" in pgadmin
date1-date2=total storage days
The date values is having null values, if i use isnull(date1,0)
ERROR:...
0
votes
2
answers
165
views
MYSQL Date diff between multiply dates in the same rows
I have table with changelog, every row give me specify inormation about actions.
Example:
Ticket closed on 2022-06-26 14:12:07.000
Ticket reopened on 2022-06-28 08:35:59.000
Ticket closed on 2022-06-...
1
vote
1
answer
260
views
Converting Total Months to Days Showing Wrong Result
I want to make an age calculator. What I want here is to show the current age and convert that age to total months and days and convert those whole months and days together to total days.
But, I am ...
2
votes
1
answer
226
views
Period between LocalDates produces wrong results
I see that java.time.Period with java.time.LocalDates works mostly as desired and I can use it to get the duration between two dates in years, months and days but I found an example that is not ...
0
votes
1
answer
258
views
Pandas: Count days excluding weekends between date columns
Dataframe to start with:
df = pd.DataFrame({
# some ways to create random data
'User Story Id':np.random.choice( ['US111111','US111112','US111113','US222221','US222222','US222223'], 6,replace=...
2
votes
0
answers
90
views
SQL Query - Identifying entries between payment dates greater than 6 years
I have this table (in reality it has more fields but for simplicity, it will demonstrate what I'm after)
Payment_Type
Person ID
Payment_date
Payment_Amount
Normal
1
2015-01-01
£1.00
Normal
1
2017-01-...
1
vote
1
answer
165
views
PHP convert two dates to unix timestamps, subtract the two timestamps to find the difference between the two dates in seconds. unxepected results?
As per title, I'm trying to find the differance in seconds then covert these seconds to days and hours.
Having read and followed similar questions I have built a function that adds my desired hours, ...
1
vote
1
answer
1k
views
How can I check if 24 hours have passed between two dates in kotlin?
I need to check if 24 hours have passed between two dates. If 24 hours have passed, I will update the data in my room database, if not, I will not. How can I do that. I thought about keeping a date ...
0
votes
1
answer
132
views
postgres - window function - date difference within a groups
I searched and saw potential results but with my skills I'm not able to adapt them.
I have a table:
date
record status
1.10.2022
open
2.10.2022
waiting
3.10.2022
approved
5.10.2022
open
6.10.2022
...
0
votes
0
answers
616
views
Kotlin date time comparison
I am trying to figure out how this works. My initial date is: "2022-11-06T08:39:16.307Z"
So now I did this:
val sdf = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
sdf....
0
votes
0
answers
58
views
PHP date_diff with if statement doesn't work properly
I'm trying to calculate the difference between two different hours. Everything work fine! I create a function that return me the H:i:s
function dateDifference($date_1 , $date_2 , $differenceFormat = '%...
0
votes
3
answers
119
views
How to write an algorithm that count the duration of time without repetitions
We have an array of date interval arrays:
[[start_date, end_date], [], ...]
For example:
[
[01.02.2020, 01.05.2020], # 3 months
[01.01.2020, 01.10.2020], # 9 month, but we cant count ...
-1
votes
1
answer
37
views
SQL Query Self Join / 2x Minimum
I want to know the time difference when first time Status HD05/SD05/HD04 was set and the first time HD10/SD10 was set.
heres a part of the table (the status can be set twice or more ... i want the ...
0
votes
1
answer
192
views
Analyzing Date difference between two dates to text : "before: x Days, x Hours, x Minutes"
I have done a lot of research to find code examples for this, or simillar question but I didn't find any.
I have a react app that has some customer requests in it, and I want to show next to each ...
0
votes
1
answer
238
views
How can I get the values of corresponding day of the week and last week and future conditionals in SQL Server?
I have a column of "Date", and I would like to obtain this conditionals that I put in a picture to easy imagination:
For example: today was 30/09/2022, take the values of the week complete ...
1
vote
2
answers
706
views
How to filter the closest date of one column that is close to the date of another column in R?
The topic might sound confusing. Here's an example:
ID
Index Date
Reference Date
Diagnosis
123
2004-07-15
2004-07-20
Depression
123
2004-07-15
1999-04-08
Anxiety
456
2000-01-15
1998-03-15
Bipolar
456
...
1
vote
2
answers
158
views
How to keep rows based on conditions of a data frame
I have a df like below
VisitDate FirstDate ID Dx
0 2018-04-16 NaT 7410013407 OtherPA
1 2018-05-15 2018-05-15 7410013407 PA
2 2018-05-15 NaT 7410013407 ...
1
vote
1
answer
61
views
What PHP is needed to calculate due date from todays date
I need a few if/elseif/else statements (which I loosely understand) to display different things based on how far away a due date is from today. Example below:
If due date is > 4 weeks away, ...
0
votes
2
answers
225
views
Filter array rows if datetime value is within 10 minutes of target time
I do a foreach on an object that I call $file. This object has a property which is the datetime ($file[6]) and another with the name ($file[0]). I need to add the object to an array if the difference ...
1
vote
0
answers
114
views
date_diff() expects parameter 1 to be DateTimeInterface (Gravity Forms)
Would love any help to this warning please.
if ( $target_field->type == 'date' && $modifier2[0] == 'daysdifference' ) {
$d2 = explode('/', $target_field4);
$dates4 = $d2[...
0
votes
1
answer
105
views
Python: monthly difference between two dates
I have two date fields that I want to get the monthly difference on a 30-year loan term. The dates are actually in yyyy-mm-dd format in my dataset, however, when I check the dtype in Python it says ...
0
votes
0
answers
201
views
online java compilers gives different results than eclipse and intelliJ
The code simply extract the time portion of two timestamps and sub them from each other to get the duration
import java.util.Calendar;
public class Test {
public static void main(String[] args) {
...
1
vote
1
answer
169
views
Calculate uptime per day from timestamps spanning several days
I have a list of incidents/downtime as follows that can span (or not) over multiple days for which I'd like to calculate the daily uptime (per device) using PySpark. Example dataset:
+--------+--------...
0
votes
1
answer
2k
views
PROC SQL in SAS date difference
I have dates from two different datasets and I want to find the difference between the two dates such that only those with difference under 20 is included in the PROC SQL table. However, I am getting ...
1
vote
2
answers
88
views
How to do conditional calculations in Python
I have a sample data that looks like this.
Column DateDuration was calculated in Excel, following below logic:
DateDuration between SecondDate and FirstDate >= 28, then DateDuration = SecondDate - ...
0
votes
1
answer
962
views
Postgres - Sum Of The Difference Between Two TIMESTAMPS For All Users
I have two tables, users and trips.
users:{
id: BIGSERIAL PRIMARY KEY
name: VARCHAR(255)
phone: VARCHAR(255)
}
trips:{
id: BIGSERIAL PRIMARY KEY
user_id: BIGINT
started_at: TIMESTAMP
...
0
votes
0
answers
43
views
I would like to calculate days between 2 date in days with condition
This is my code :
df["mois0"]=pd.to_datetime("01/10/2021")
df["mois1"]=pd.to_datetime("31/10/2021")
def calculAbsMois(datedebut, datefin, d0, d1):
if ...
0
votes
1
answer
429
views
Calculate difference between highest and lowest value by group in R
I want to calculate the holding period for a dataframe that consists of etherreum transactions. So far I managed to do so using this code:
holdingtime <- fullsample3 %>%
group_by(id) %>%
...