There is a field defined in the SQL Server DB as DateTime.
I need to show only the time – 5 PM . Is it possible through C# to have it show only the Time so that it can go in the DB properly. If so, how do you display the time in C# as 5 PM?
There is a field defined in the SQL Server DB as DateTime. I need
Share
DateTime.Now.ToShortTimeString()is probably the closest you’re gonna do without a custom format string. The output looks likeSo, it doesn’t matter how you store it in the database.
ToShortTimeString()will only display the time.