Question about dates
-
I am trying to compare dates from my C# project file to the dates from my database. What I want to achieve is to check if the same date occured in the database. How do I do this? For example I want to check if DateTime.Now already existed in the database. I am trying to read it from there, however I need only the date, not the time. I have to omit this, because my plan was to convert them to strings and then just compare if they existed already. Can anyone help?
-
I am trying to compare dates from my C# project file to the dates from my database. What I want to achieve is to check if the same date occured in the database. How do I do this? For example I want to check if DateTime.Now already existed in the database. I am trying to read it from there, however I need only the date, not the time. I have to omit this, because my plan was to convert them to strings and then just compare if they existed already. Can anyone help?
just call .Date on the date object.
DateTime.Now.Date
Simon
-
just call .Date on the date object.
DateTime.Now.Date
Simon
-
:laugh: No worries. It's easily missed if you don't know it's there.
Simon
-
just call .Date on the date object.
DateTime.Now.Date
Simon