DateTime.Now.Date.ToString() |
7/15/2007 1:30:27 AM |
ASPRunner.NET General questions | |
T
thecomputerguy author
Hello when I set a datetime field with DateTime.Now.Date.ToString() |
|
T
|
thecomputerguy author 7/15/2007 |
Hello when I set a datetime field with DateTime.Now.Date.ToString() to store datetime in a datetime field in SQL 2005 the record is saved but is does not save the time stamp on it just the DATE. I have search the web and there is been an issue with this and wanted to know if you all have a suggestion? [codebox] e.Command.Parameters("@dUpdateDate").Value = DateTime.Now.Date.ToString() [/codebox] SQL field is set up as: dUpdateDate datetime Results: dUpdateDate = 7/15/2007 12:00:00 AM stored inthe database even though it was saved at 12:28 AM I foundthis site that talk about this issue also: Issue is also talked here |
T
|
thecomputerguy author 7/15/2007 |
I was curious so I run a trace on the SQL server and noticed tha the Time is not getting passed to the SQL |
|
Eugene 7/16/2007 |
All that you need is to set up "view as" as Datetime and "edit as" as simple edit box with datepicker + show time in datepicker at formatting page. |