获取特定日期的日期时间 [英] to get datetime for a specific date

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

问题描述


我的项目是使用c#
的asp.net 在其中一个Webform用户中选择日期
日期:
时间:
约会ID
如果他选择的日期我想在之后显示一段时间(他选择的时间加上某个时间)并自动按时显示,请给我发送代码.我正在三层体系结构中进行操作.
在此先感谢

hi ,
my project is asp.net with c#
in one of the webform user selects date
date:
time:
appointment_id
if he selects date i want to display some time after(the time he selected plus some time )and display it automatically on time ,plz send me the code.i am doing it in three tier architecture .
thanks in advance

推荐答案

您可以使用TimeSpan 类向DateTime 对象添加时间.

You can use the TimeSpan class to add time to the DateTime object.

System.TimeSpan duration = new System.TimeSpan(0, 0, 0, 1);
System.DateTime answer = today.Add(duration);



此处 [



Read more about TimeSpan here[^].


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

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