Depending on today’s date
How can we check if Sunday has passed
Example
1.Check in First 7 days of Month
**If Today is 2nd May **
**Then ** Log msg(“Sunday is Not Present in Week Passed”)
Else If Today’s date is 5th June
**Then ** Log Msg (“Sunday is Present in Week Passed”)
It should check before dates if Sunday is Present i.e 1 to 4th June if it contains Sunday
could you please try this vb.net code in invoke code activity.
Imports System
Public Class Main
Public Shared Sub Main()
Dim today As DateTime = DateTime.Now
Dim sunday As DateTime = today.AddDays(-(today.DayOfWeek - DayOfWeek.Sunday))
If today.DayOfWeek < DayOfWeek.Sunday Then
Console.WriteLine("Sunday has not passed in the week.")
Else
Console.WriteLine("Sunday has passed in the week.")
End If
End Sub