HI Everybody,
i am using datetimepicker and i want to calculate previous date of date selected by user
please reply me as soon as possible.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Hirendra SisodiyaPosted Mar 23, 2010, 7:07 AM
for more information about it you can go to msdn :
http://msdn.microsoft.com/en-us/library/system.datetime.adddays.aspx
if my answere helps you please mark as answere
thanks
ankush belorkarPosted Mar 23, 2010, 1:54 AM
Thank you very much
Hirendra SisodiyaPosted Mar 23, 2010, 1:44 AM
Use add days method for finding previous date
DateTime dt = default(DateTime);
dt = DateTimePicker1.Value.AddDays(-1);
thanks
Please mark as answere if you like my answere
RujutaPosted Mar 23, 2010, 1:36 AM
DateTime date = new DateTime();
date = DateTime.Now;
DateTime newdate = new DateTime();
newdate=date.Subtract(new TimeSpan(1,0,0,0));
Tru it, should work fine for you.....