Click here to Skip to main content
12,445,719 members (58,587 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C#
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
Hari
Posted 3-Feb-13 6:54am
Rate this: bad
 
good
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;
  Permalink  
v2
Comments
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?
   
yes
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

Hi,
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.

Cheers
BS.
  Permalink  

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.160811.3 | Last Updated 5 Feb 2013
Copyright © CodeProject, 1999-2016
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