C# – how to ignore the seconds ToShortTimeString

c

My datetime is showing me the seconds eventhough i have put as this
TimeSlotFrom = Value.ToShortTimeString();

I can view it from my laptop only HH:mm. However when read from your client's pc, it show it as HH:mm:ss.

does it relates to the time format used in my client's pc? How do i handle this to just show HH:mm ?

Best Answer

use Value.ToString("HH:mm") to always get the same format, because ToShortTimeString uses the format defined on the PCs culture.