Displaying time only, without date

Yuliya

Active member
Joined
Nov 9, 2007
Messages
34
Programming Experience
Beginner
I have a field in my database table that represents the time of the day. The type is datetime. In my Windows Form, I have a DataGridView that displays that database table. How can I set it to display only the time, without some default date that is part of datetime?

Thank you!
 
If you're working with a DataGridView try this:

1. open its tasks (pressing the little arrow on the top right of the table
2. edit columns
3. select column you want to format on the left
4. open DefaultCellStyle on the right, pressing the [...] on the right
5. open Format, pressing the [...] on the right
6. choose the format you like from the DateTime list, probably you need t format

I hope this helps
 
Back
Top