calculate Days months between two dates.
For Eg: Start Hiring Date: 1 Jan 2020 To Today (5 March 2021)
What expression should I Use to get a result? I need an expression for Years/Months and Days.
1 year, 2 months, 4 days
I can use separate columns (expression) for each Year, Months, and Days.
I have already followed precious expressions: 1. (Startdate-Today).TotalDays 2. DateDiff(Startdate,today).Days
Not getting Correct result. Please Help!
Calculate Days months Years between two dates
-
- Posts: 22
- Joined: Wed Dec 05, 2018 12:01 am
-
- Posts: 6680
- Joined: Tue Mar 20, 2018 5:34 am
Re: Calculate Days months Years between two dates
Hello,
You can use the following expression:
{(DateTime2 - DateTime1).Days}
And then calculate years, months, and days separately as you need.
Thanky ou.
You can use the following expression:
{(DateTime2 - DateTime1).Days}
And then calculate years, months, and days separately as you need.
Thanky ou.
Re: Calculate Days months Years between two dates
Hello all. I’ve been searching for a solution to get the difference between two dates in years, months and days like 10th of April 2021 was 2 years, 2 months and 11 days ago, or 12th of Juli 2023 was 0 years, 2 months and 12 days ago. (in reference to current date 24/9/21).
I know how to get the amount of years incontagem ferias, this should be done by calanderYearsBetween(Date1, CurrentDate), the amount of monts should be something like calanderMonths(Date1, CurrentDate) – (12 * amountOfYears). But I can’t think of something to get the amount of days.
Is there any option to calcualte something like this, it needs to be exact...
I know how to get the amount of years incontagem ferias, this should be done by calanderYearsBetween(Date1, CurrentDate), the amount of monts should be something like calanderMonths(Date1, CurrentDate) – (12 * amountOfYears). But I can’t think of something to get the amount of days.
Is there any option to calcualte something like this, it needs to be exact...
-
- Posts: 6680
- Joined: Tue Mar 20, 2018 5:34 am
Re: Calculate Days months Years between two dates
Hello,
Please try to check the following solution:
https://stackoverflow.com/questions/382 ... in-c-sharp
Thank you.
Please try to check the following solution:
https://stackoverflow.com/questions/382 ... in-c-sharp
Thank you.
- Attachments
-
- Screenshot 2023-02-09 093752.png (83.26 KiB) Viewed 1679 times
-
- DateDiff-YearMonthDays.mrt
- (10.1 KiB) Downloaded 165 times