How to get the weekday out from a string variable that holds a date?


i am trying to get the week day out from a string variable that is not a datetime , but a string that holds a date.

how can i do it?


What is the String?

for example the string variable holds on the date 30/07/2000, i want to get the day of the week


Try This

Date.ParseExact("30/07/2000", "dd/MM/yyyy", nothing).DayOfWeek

can i change the “30/07/2000” to a variable name?

yes. String variable

it doesn’t work

Date.ParseExact(dateStr.Trim, "dd/MM/yyyy", nothing).DayOfWeek
1 Like

still not working
Date.ParseExact(“Calculated_Date_For_Next_Action.Trim”, “dd/MM/yyyy”, nothing).DayOfWeek

thank you

I have updated the code. please remove quotes from the variable name

Date.ParseExact(Calculated_Date_For_Next_Action.Trim, "dd/MM/yyyy", Nothing).DayOfWeek
1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.