Hi Team,
I have to write a file name along with week number in a month, could you please help with this doubt .
Thanks,
Manoj
Hi Team,
I have to write a file name along with week number in a month, could you please help with this doubt .
Thanks,
Manoj
@manojmanu.rpa ,
Can you share a sample filename Assuming Today’s Date?
Regards,
If you want to write the today’ date then use the expression and store it a variable.
Hope it helps!!
Hi
FileName =YourVariableName + “_” +DateTime.Now.ToString(“yyyy-MM-dd”)
I hope this will help you,
Thank you
@manojmanu.rpa
Try this one to write week number in file.
"yourFilename"+DateTime.Now.ToString("MM") + "-" + (DateTime.Now.Day / 7 + 1).ToString()+"yourfileExtension"
Please try this
“Filename_” + DateTime.Now.ToString(“MM”) + “Week” + ((DateTime.Now.Day - 1) / 7 + 1).ToString()
Thank you
Try this:
Datetime--->In_Date = Convert.ToDateTime("07/17/2023")
Datetime---->BaseDate = new DateTime(In_Date.Year, In_Date.Month, 1)
Int64---->out_week = DateAndTime.DateDiff(DateInterval.WeekOfYear ,Basedate, In_Date, FirstDayOfWeek.Monday,FirstWeekOfYear.Jan1)
Output: FileName + (out_week+1).ToString
Regards,
Here is the File with your Expected Output.
Assign activity: firstDayOfMonth = New DateTime(currentDate.Year, currentDate.Month, 1)
Assign activity: firstWeekNumber = CultureInfo.CurrentCulture.Calendar.GetWeekOfYear(firstDayOfMonth, CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Monday)
Assign activity: currentWeekNumber = CultureInfo.CurrentCulture.Calendar.GetWeekOfYear(currentDate, CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Monday)
Assign activity: weekNumberInMonth = currentWeekNumber - firstWeekNumber + 1
BlankProcess3.zip (389.9 KB)
Hope it helps!!
Try this:
File_Name_Variable + System.DateTime.Now.toString(dd-MM-yyyy) + “.FIle_Extension”
This will work. Thanks
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.