Hello I want to show current date , time and day name in a label in c# windows form. I have put following code
datetime.Text = DateTime.Now.ToString("dd-MMM-yyyy hh:mm tt");
and now I have to show current day name. How to do that?
SidraM says: DateTime.Now.ToString("dd-MMM-yyyy hh:mm tt");
DateTime.Now.ToString("dd-MMM-yyyy hh:mm tt");
DateTime.Now.ToString(
"dd-MMM-yyyy hh:mm tt"
);
replace above code with below
DateTime.Now.ToString("dd-MMM-yyyy dddd hh:mm tt");
and if you only want day name then refer below code
DateTime.Now.ToString("dddd");
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.