Reputation: 4971
How to get the time value in a stored procedure from a DateTimePicker
value?
For Example:
I have a datetime picker value stored into my table as:
'2010-04-06 09:00:00.000'
'2010-04-07 14:30:00.000'
Convert(varchar,Date,3) as Date
Convert(time,Time)
But it show the values as 9:00 or 14:30
I need it to show them as 9:00AM and 2:30PM instead of 14:30.
Upvotes: 0
Views: 9698
Reputation: 5025
try something like that:
date.ToString("hh:mm tt", CultureInfo.InvariantCulture);
Upvotes: 0