Click here to Skip to main content
Rate this: bad
good
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 7: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 at 3-Feb-13 13:24pm
   
@Abhinav itz not working.
Abhinav S at 3-Feb-13 23:27pm
   
Are you getting an error?
Hari Krishna Prasad Inakoti at 4-Feb-13 0:37am
   
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
0 Sergey Alexandrovich Kryukov 385
1 DamithSL 210
2 Kornfeld Eliyahu Peter 210
3 OriginalGriff 180
4 Peter Leow 95
0 OriginalGriff 7,215
1 DamithSL 5,199
2 Maciej Los 4,866
3 Sergey Alexandrovich Kryukov 4,757
4 Kornfeld Eliyahu Peter 4,514


Advertise | Privacy | Mobile
Web03 | 2.8.141223.1 | Last Updated 5 Feb 2013
Copyright © CodeProject, 1999-2014
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