Match error string-datetime

I have some issues converting a string to a datetime.
What i have is in 'for each ’ activity , for each called currentitem and in a variable of string containing a date format.

Appear the next error:

i want to make this convert to use as a condition at this way : Convert.ToString(DateTime.Fecha.DayOfWeek).Contains(“Friday”)

How can i fix this issue?

Hi,

Do you need to get weekday string? If so, how about the following?

CDate(currentItem).ToString("dddd")

CDate(currentItem).ToString("dddd")="Friday"

Regards,

What is the CDate?

Hi,

It’s like Convert.ToDateTime or DateTime.Parse.
Please see the following document in details.

Regards,

i am not working in VB, i am using C#, Windows , is compatible¿

All right. Can you try to use Convert.ToDateTime or DateTime.Parse, as the following?

image

It might be necessary to use DateTime.ParseExact, depnding on your input string.

Regards,

Convert.ToString(DateTime.Now.DayOfWeek).Contains("Friday")

Regards,
Arivu

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