DateTime GetFridayDate(DateTime standardDate)
        {
            int weekNum = (int)standardDate.DayOfWeek;
            DateTime fridayDate 
= standardDate;

            
if (weekNum > 0 && weekNum <= 5)
            {
                fridayDate 
= standardDate.AddDays(5 - weekNum);
            }
            
else
            {
                
if (weekNum == 6)
                {
                    fridayDate 
= standardDate.AddDays(-1);
                }
                
else if (weekNum == 0)
                {
                    fridayDate 
= standardDate.AddDays(-2);
                }
            }

            
return fridayDate;
        }

相关文章:

  • 2021-07-17
  • 2022-12-23
  • 2022-12-23
  • 2021-11-18
  • 2022-01-06
  • 2021-07-05
猜你喜欢
  • 2022-12-23
  • 2021-08-14
  • 2022-12-23
  • 2021-09-18
  • 2022-12-23
  • 2021-08-24
  • 2022-12-23
相关资源
相似解决方案