Click here to Skip to main content
13,005,871 members (91,465 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hi all,
I have two textboxes,one is calendar extendar and another one is normaltext box.I want to calculate calendarextender date to current date .I want output as a date.
Please advice me.

Thanks & Regards
Posted 3-Feb-13 6:54am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Try, in one line,
int age = new DateTime(DateTime.Now.Subtract(extenderDate).Ticks).Year-1;
Hari Krishna Prasad Inakoti 3-Feb-13 13:24pm
@Abhinav itz not working.
Abhinav S 3-Feb-13 23:27pm
Are you getting an error?
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

I am a little confused you need output as Date? for example if extender date is date of birth and text box date istodays date, we can calculate the difference in years, months or days, However output as date I am bit lost here. Can you please brief your requirement.


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170627.1 | Last Updated 5 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100