I have a web application using visual studio 2013. I have connected SQL server 2008 with this web application. The user inputs a date with a format of
yyyy-mm-dd
. Then this is sent to sql server. When I open sql server and view my database the entry for date reads as yyyy-mm-dd.
I have another page on my web application that calls data from the database and populates the web form. When it populates the date field it is populated as mm/dd/yyyy 12:00:00 AM. As far as I can tell I have all of my data types set to date.
I have reached the data types for sql and html. What I found is the format should just be a date with no time.
Ex.) yyyy-mm-dd
I also read through this question How to return the date part only from a SQL Server datetime datatype but I am not sure how to apply it to my problem. I am not using data type 'datetime'. Any suggestions or help would be greatly appreciated!
Edit: When I run my web application I have added a breakpoint to see what value the program is reading from the database and it says yyyy-mm-dd 12:00:00 AM. I don't know if this will help figure things out or not.