关于日期的问题 [英] question about date

查看:99
本文介绍了关于日期的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

让我举个例子:合同的开始日期是:1/7/2007,合同的期限是13年.我们需要使用window form visual studio 2008中的代码来获取日期吗?合同终止日期为30/6/2020? thx为您提供帮助.

let me give an example :the date of beginning of a contract is: 1/7/2007 and the period of contract is 13 years what is the code in window form visual studio 2008 do we need to use for getting the date of the end of the contract on the 30/6/2020 ?? thx for your help.

推荐答案

通过阅读有关 ^ ] ...:rolleyes:
By reading about the DateTime struct[^]... :rolleyes:
// Constructor using year, month, day.
DateTime d = new DateTime(2007, 1, 7);
// Add 13 years and assign the result to your date.
// Dates are immutable, like Strings.
d = d.AddYears(13);
// d now holds the original date + 13 years.


不知道您的月份是7,天是1,反之亦然.取决于您的国家.


Not sure if your month is 7 and day is 1 or vice versa. Depends on your country.


这篇关于关于日期的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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