How to compare the Time of the Received Email, where it should not belong to perticular Time Interval


#1

Hi All,
An Email Received - So i need to validate the Received Time of the Email, in such a way that,
it should not belong to perticular Time Interval.

Say, Received Time = 2PM
Condition should be like,
If Received time is between 3Pm to 4pm, then Bot should Run.

-Thanks.


#2

@Pavan_Kodali split 2PM into 2 and PM. First check obtain value=PM if it equal and check condition received number is in between 3 and 4(recviednum>=3 and recviednum<=4)


#3

you should have two variables with TimeSpan datatype called startTimeSpan and endTimeSpan, then

inside assign activity have it startTimeSpan = New TimeSpan(2, 00, 00)
another assign activity endTimeSpan = New TimeSpan(3, 00, 00)

then inside a If

Convert.ToDateTime(mail.Headers(“Date”).ToString).TimeOfDay > startTimeSpan and Convert.ToDateTime(mail.Headers(“Date”).ToString).TimeOfDay< endTimeSpan