views:

197

answers:

2

how to get the time value in a stored procedure form datepicker value

i.e 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'

i have got the date sepeartely using convert(varchar,Date,3) as Date.. i have got the time seperately using convert(time,Time)

but it show the values as 9:00 , 14:30

i need it to show as 9.00 am and 2.30pm instead of 14.30.

How to achieve this????????? and help??????

A: 

try something like that:

date.ToString("hh:mm tt", CultureInfo.InvariantCulture);
darja
A: 

you can use yourDate.ToString("t");

also check other formats

Hun1Ahpu
thank you. it works out fine...
Ranjana