Kquick
(Tord)
February 21, 2024, 8:34am
1
Hi,
I have a dymaic date that I’m struggelign to compare to another date.
I’m using the get text function to get the date that is 20.02.2024. Then I want to know if that is older than 7 days. If it’s older then seven days then I want to do write a message older than 7 days.
rlgandu
(Rajyalakshmi Gandu)
February 21, 2024, 8:36am
2
@Kquick
isOlderThan7Days = DateTime.ParseExact(yourDateString, "dd.MM.yyyy", System.Globalization.CultureInfo.InvariantCulture) < DateTime.Now.AddDays(-7)
ppr
(Peter Preuss)
February 21, 2024, 8:39am
3
Kquick:
20.02.2024.
@Kquick
Welcome to the forum
We would parse the string into a datetime variable and check within an if activity
We suggest to baseline the Date with appended Date Property retrieval:
Parvathy
(PS Parvathy)
February 21, 2024, 8:40am
4
Hi @Kquick
Try the below
Assign:
extractedDateTime = DateTime.ParseExact(YourGetTextFunction(), "dd.MM.yyyy", CultureInfo.InvariantCulture)
difference = DateTime.Now.Subtract(extractedDateTime).TotalDays
If:
difference > 7
Then:
Write Line or Log Message: "older than 7 days"
system
(system)
Closed
February 24, 2024, 8:40am
5
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.