Click here to Skip to main content
16,015,274 members
Home / Discussions / C#
   

C#

 
GeneralRe: resize rectangle Pin
Try31-Jan-08 2:22
Try31-Jan-08 2:22 
GeneralRe: resize rectangle Pin
Justin Perez31-Jan-08 2:46
Justin Perez31-Jan-08 2:46 
GeneralInvoking extension methods asynchronously Pin
Nenad Panić31-Jan-08 1:10
Nenad Panić31-Jan-08 1:10 
GeneralRe: Invoking extension methods asynchronously Pin
Roger Alsing31-Jan-08 1:21
Roger Alsing31-Jan-08 1:21 
GeneralRe: Invoking extension methods asynchronously Pin
Nenad Panić31-Jan-08 1:39
Nenad Panić31-Jan-08 1:39 
GeneralRe: Invoking extension methods asynchronously Pin
PIEBALDconsult31-Jan-08 5:13
mvePIEBALDconsult31-Jan-08 5:13 
Generalcreating deployment exe file on the fly Pin
samy10031-Jan-08 1:07
samy10031-Jan-08 1:07 
GeneralGetting todays date Pin
Gareth H30-Jan-08 22:53
Gareth H30-Jan-08 22:53 
Hi,

I need to select some data from my DB where the date is only today, so i do a between (startDate and endDate). It was working fine with the below code:

DateTime betweenStart = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 0, 0, 0, 0);
DateTime betweenEnd = new DateTime(DateTime.Now.Year, DateTime.Now.Month, (DateTime.Now.Day + 1), 0, 0, 0, 0);


It stopped working today, because todays date - 31th Jan - is not a valid date with the above, eg: 31 + 1 = 32nd Jan.

So i tried using the Add method on DateTime, but whatever i add - hours, days, seconds - it never changes anything.

betweenEnd.AddHours(24);


The only thing i do with the DateTimes after creating them is to do a ToString().

Anyone know of a better way to get my solution or can see what i am doing wrong?

Regards,
Gareth.
GeneralRe: Getting todays date Pin
Ed.Poore30-Jan-08 22:58
Ed.Poore30-Jan-08 22:58 
GeneralRe: Getting todays date Pin
Colin Angus Mackay30-Jan-08 23:21
Colin Angus Mackay30-Jan-08 23:21 
GeneralRe: Getting todays date Pin
Ed.Poore31-Jan-08 0:08
Ed.Poore31-Jan-08 0:08 
GeneralRe: Getting todays date Pin
Colin Angus Mackay31-Jan-08 6:47
Colin Angus Mackay31-Jan-08 6:47 
GeneralRe: Getting todays date Pin
Ed.Poore31-Jan-08 7:23
Ed.Poore31-Jan-08 7:23 
GeneralRe: Getting todays date Pin
darkelv30-Jan-08 23:02
darkelv30-Jan-08 23:02 
AnswerRe: Getting todays date Pin
Gareth H30-Jan-08 23:03
Gareth H30-Jan-08 23:03 
GeneralRe: Getting todays date Pin
Ravi Bhavnani31-Jan-08 0:31
professionalRavi Bhavnani31-Jan-08 0:31 
GeneralRe: Getting todays date Pin
DaveyM6930-Jan-08 23:10
professionalDaveyM6930-Jan-08 23:10 
GeneralRe: Getting todays date Pin
Pete O'Hanlon30-Jan-08 23:32
mvePete O'Hanlon30-Jan-08 23:32 
GeneralRe: Getting todays date Pin
Gareth H31-Jan-08 0:07
Gareth H31-Jan-08 0:07 
GeneralRe: Getting todays date Pin
Pete O'Hanlon31-Jan-08 2:59
mvePete O'Hanlon31-Jan-08 2:59 
AnswerRe: Getting todays date Pin
Guffa31-Jan-08 3:35
Guffa31-Jan-08 3:35 
GeneralRe: Getting todays date Pin
PIEBALDconsult31-Jan-08 8:05
mvePIEBALDconsult31-Jan-08 8:05 
Generalxml and lable Pin
samidhas30-Jan-08 22:25
samidhas30-Jan-08 22:25 
QuestionHow to get processes even if their name changed? Pin
spearwall30-Jan-08 22:17
spearwall30-Jan-08 22:17 
AnswerRe: How to get processes even if their name changed? Pin
mav.northwind30-Jan-08 23:40
mav.northwind30-Jan-08 23:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.