fetch date and time separately from datetime field in C#.net
-
i want to fetch time and date information separately from a datetime type field of a table created using sql 2005 of asp.net...i wasn't able to understand the pages displayed on google for the same query...??
Not sure if I understood your question correctly. You can use the convert method and pass in the style. You can get the date by using styles 101 to 107 and 108 or 114 to get the time part. This MSDN article[^] provides you with the syntax and shows the output for the various styles.
Tarakeshwar Reddy There are two kinds of people, those who do the work and those who take the credit. Try to be in the first group; there is less competition there. - Indira Gandhi
-
Not sure if I understood your question correctly. You can use the convert method and pass in the style. You can get the date by using styles 101 to 107 and 108 or 114 to get the time part. This MSDN article[^] provides you with the syntax and shows the output for the various styles.
Tarakeshwar Reddy There are two kinds of people, those who do the work and those who take the credit. Try to be in the first group; there is less competition there. - Indira Gandhi
i've used a gridview datasource control to display the schedule ....thr in i've specified the time field as datetime datatype in the table....nw when i'm displaying the page along with time, date is also being displayed...i don want to display the date....but only time....can you help me...???
-
i've used a gridview datasource control to display the schedule ....thr in i've specified the time field as datetime datatype in the table....nw when i'm displaying the page along with time, date is also being displayed...i don want to display the date....but only time....can you help me...???
You can use a bound field and set the DataFormatString.
Take a look at the Standard DateTime Format Strings [^] and this article[^] which shows you how to create a bound field.
Tarakeshwar Reddy There are two kinds of people, those who do the work and those who take the credit. Try to be in the first group; there is less competition there. - Indira Gandhi