jntrk
(jntrk)
November 25, 2020, 11:55am
1
Hello everyone,
I write to an excel the date of today using : Now.ToString(“d.MM.yyyy”) , after some time I need to check how many days passed after my last writing of the date so actually I need something like:
read cell and output as “date” ,
if
date - Now.ToString(“d.MM.yyyy”) = 3 do . . . . . . . . .
else
do this.
How can I do “” date - Now.ToString(“d.MM.yyyy”) = 3 “”
ty.
edit:: so format of the date is like 15.03.2020
Sorry for late reply:
Use assign value :
daysvalue type should be double
daysvalue=(Convert.ToDateTime(sdate) - datetime.Now.ToString(“dd-MM-yy”)).TotalDays
after run this above command, you will get days
Let me know if any issue
Happy Automation!
Regards
Sagar
1 Like
In sdate you will get value from your excel
Jacqui_M
(Jacqui Muller (MEA))
November 26, 2020, 11:46am
4
This is a classy solution. Thank you for sharing @Sagar_Gupta1
Mark as solution if it work
1 Like
Jacqui_M
(Jacqui Muller (MEA))
November 26, 2020, 11:49am
6
If it were my post, I would
jntrk
(jntrk)
November 26, 2020, 12:29pm
7
DateDiff(DateInterval.Day, DateTime.ParseExact(ExampleDate, "dd.MM.yyyy", System.Globalization.CultureInfo.InvariantCulture), DateTime.Now).Tostring
I have actually managed to make it work with this code.
Ty anyways
1 Like
system
(system)
Closed
November 29, 2020, 12:29pm
8
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.