I’m trying to build a process which downloading from a sftp server and I need to download the last version that uploaded in the same week
I write this condition
“>” + Now.AddDays(count).ToString(“yyyy-mm-dd”)
it displays like this 19-22-2020 and when I keep runnung the process it increase like 19-23-2020
Thanks
Hi @nawa_qahtani
for “same week” you mean “last 7 days” or “everyday from last monday\sunday”?
notice I put it in while loop with the count>0 condition
the file is uploaded in this week any day in the week I need the last version
for ex: file uploaded on Sunday another in Wednesday, I need to download the Wednesday
And which is the step you are having problems with?
I use this condition “>” + Now.AddDays(count).ToString(“yyyy-mm-dd”) in type into activity and doesn’t display the write date
Have you tried to change the input Options?
Check if this video helps you @nawa_qahtani
ppr
(Peter Preuss)
November 19, 2020, 10:46am
10
@nawa_qahtani
we can get the current weeknumber of year by a date with following:
CultureInfo.InvariantCulture.Calendar.GetWeekOfYear(now ,CalendarWeekRule.FirstDay,DayOfWeek.Monday)
so we can check a date if it is falling into the current week by:
CultureInfo.InvariantCulture.Calendar.GetWeekOfYear(now ,CalendarWeekRule.FirstDay,DayOfWeek.Monday) = CultureInfo.InvariantCulture.Calendar.GetWeekOfYear(YourDateTimeVar ,CalendarWeekRule.FirstDay,DayOfWeek.Monday)
find starter help here:
CheckDate_IsInCurrentWeek.xaml (6.1 KB)
ensure following: