How to get WeekDay for a Given "dd.MM.YYYY"?

Dears,

How to get WeekDay for a Given “dd.MM.YYYY” ? Thx

1 Like

Assuming it’s a string, you first convert to a datetime variable, then you use the .DayOfWeek property https://docs.microsoft.com/en-us/dotnet/api/system.datetime.dayofweek?view=netframework-4.8

So if you wanted to return it back as a string it’d be something like this: Datetime.ParseExact(YourDateAsStringVariable,"dd.MM.yyyy",System.Globalization.CultureInfo.InvariantCulture).DayOfWeek.ToString

EDIT: Forgot to add in the cultureinfo portion for datetime.parseexact

5 Likes

Now.DayOfWeek.ToString

@HareeshMR, Thanks for reply but this will return only today, but I want an arbitrary day dd.MM.YYYY.Thx

Yeah, above solution by @Dave will work :slight_smile:

2 Likes

YES it’s working, but still returns some errors, Could you please help? I have attached related files.Dates.xlsx (8.9 KB) Sequence.xaml (9.9 KB)
Strange!!!It’s recording in column B until today only !!!

I fixed issue by removing Globalization from Datetime.ParseExact(YourDateAsStringVariable,"dd.MM.yyyy",System.Globalization.CultureInfo.InvariantCulture).DayOfWeek.ToString

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