I am trying to generate an IF condition that compares a datetime variable from a previous activity with the current date. I do not want time to appear. My current condition reads: “variable < Date.Now” but I don’t believe this will inspire the bot to take the next step.
@Palaniyappan As always, I appreciate your speed and accuracy!
One follow up question, if I may. I don’t want time to come through in the next step of my IF condition. I would like a Type Into and have this code:
Now.ToString(“mmddyyyy”) would the exclude the time? I have a write line on the initial variable and it is writing out time so I just want to check this.
yes of course, it will exclude time stamp in it…and will give only the format that you have mentioned in the ToString argument
as you have mentioned here Now.ToString(“MMddyyyy”) it will give the output only in the format specified like 06112019
and one more thing MM is for month and mm is for minutes buddy…
Fine i would like to tell you something
this would surely help you buddy
Ok, I have a follow up question to all this. My IF condition is now working and I appreciate the support. However, now I have another stumbling block. I need to build in where the bot will type into an application the last date of the previous month. Since that will never be the current date, how best to achieve this?
Thank you once again. This only outputs the day (Meaning it only said 31 since May has 31 days). I would need the full date. I am working with the code to accomplish this.
Fine buddy
Use a assign activity like this
where in_date is variable of type string in_date = now.AddMonths(-1).ToString(“MMyyyy”)+“/”+datetime.DaysInMonth(now.Year,now.AddMonths(-1).Month).ToString
Then we can convert the in_date like this to get the format we want, in writeline activity