如何实现年龄的计算 [英] how to implement calculation of age

查看:59
本文介绍了如何实现年龄的计算的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在输入dob时实现年龄的计算。

i need to implement calculation of age when the dob is entered.

推荐答案

你应该看一下 DateTime.Subtract [ ^ ]方法。该方法返回 Timespan [< a href =http://msdn.microsoft.com/en-us/library/8ysw4sby.aspxtarget =_ blanktitle =新窗口> ^ ]值。



剩下的由你决定,我恳请你:帮自己一个忙,看看文档!。



干杯,



- Manfred
You should have a look at the DateTime.Subtract[^] method. That method returns a Timespan[^] value.

The rest is up to you and I urge you: "Do yourself a favor and read the documentation!".

Cheers,

— Manfred


这篇关于如何实现年龄的计算的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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