如何计算从日历内容到另一个文本框的年龄? [英] how to calculate age from calendar extendar to another textbox?

查看:70
本文介绍了如何计算从日历内容到另一个文本框的年龄?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有两个文本框,一个是日历内容,另一个是普通文本框。我想计算calendarextender日期到当前日期。我希望输出为日期。

请给我建议。



谢谢和问候

Hari

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

推荐答案

在一行中尝试

Try, in one line,
int age = new DateTime(DateTime.Now.Subtract(extenderDate).Ticks).Year-1;




我有点困惑你需要输出日期?例如,如果扩展日期是出生日期和文本框日期是今天日期,我们可以计算年,月或日的差异,但输出日期我在这里有点丢失。能否请你详细说明你的要求。



干杯

BS。
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.


这篇关于如何计算从日历内容到另一个文本框的年龄?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆