Convert dd/mm/yyyy to get the day

Hi everyone,

I have a requirement to get the day from a specific date format

1 Like

Hi @Prakash_P3

Check this
DateTime.ParseExact(yourdate,“dd/MM/yyyy”,System.Globalization.CultureInfo.InvariantCulture).DayOfWeek.ToString

Yourdate is nothing but your variable here, kindly change it accordingly

Hi @Prakash_P3,
Try below method to get day name

Now.ToString("ddd")
Or
DateVariable.ToString("dddd")

ddd-> Represents the abbreviated name of the day (Mon, Tues, Wed, etc).

dddd-> Represents the full name of the day (Monday, Tuesday, etc).

If suppose your date format id dd/MM/yyyy to convert to d/M/yy
DateTime.ParseExact(yourdate,"dd/MM/yyyy",System.Globalization.CultureInfo.InvariantCulture).ToString("dddd")

Refer below link for more about date time conversion

Regards,
Arivu

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