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?
Yoichi
(Yoichi)
December 27, 2022, 9:04am
2
Hi,
Do you need to get weekday string? If so, how about the following?
CDate(currentItem).ToString("dddd")
CDate(currentItem).ToString("dddd")="Friday"
Regards,
Yoichi
(Yoichi)
December 27, 2022, 9:12am
4
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¿
Yoichi
(Yoichi)
December 27, 2022, 9:17am
6
amaia.aristeguii:
i am using C#, Windows
All right. Can you try to use Convert.ToDateTime or DateTime.Parse, as the following?
It might be necessary to use DateTime.ParseExact, depnding on your input string.
Regards,
arivu96
(Arivazhagan A)
December 27, 2022, 9:23am
7
Convert.ToString(DateTime.Now.DayOfWeek).Contains("Friday")
Regards,
Arivu
system
(system)
Closed
December 30, 2022, 9:24am
8
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.