asp.net中的日期时间差计算 [英] datetime difference calculation in asp.net

查看:80
本文介绍了asp.net中的日期时间差计算的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,
在我的网站上,我有一个系统的当前日期,我希望从当前日期开始3个月.
告诉我解决方法....
请.........

hello,
in my website i have a current date of system and i want to see 3 month before day from the current date.
tell me the solution....
please.........

推荐答案

尝试:
DateTime now = DateTime.Now;
DateTime then = now.AddMonths(-3);
Console.WriteLine(then.ToString());


或在VB中:
现在


Or in VB:

Dim now As DateTime = DateTime.Now
Dim past As DateTime = now.AddMonths(-3)
Console.WriteLine(past.ToString())


通过下面的Google搜索链接

go through the below google search link

Here[^]


这篇关于asp.net中的日期时间差计算的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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