Not sure how this happened. Today, at 10:17AM
, clicked on a button on a page.
Code passes "date" ONLY to the stored proc. I'm using a telerik control and it wont let me add "time". So, i pass the date, and in the stored proc, i contact date to time...
In this example, "10:17AM
" came out as "10:17PM
". Not sure why and how but this is my sql below.
declare @updatedate as datetime
set @updatedate ='2011-03-25'
-- getdate() (time at that time) was 2011-03-25 10:17:15.000
DATEADD(day, 0, DATEDIFF(day, 0, @updatedate)) +
DATEADD(day, 0 - DATEDIFF(day, 0, getdate()), getdate())
--not sure how that turned out to be 21:10:15:000