如何在控制台应用程序中将mints添加到datetime [英] how to add mints to datetime in console application

查看:64
本文介绍了如何在控制台应用程序中将mints添加到datetime的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

实际上我从users表中获取Created_Date_Time并保存在字符串crtdt中。现在我想为Created_Date_Time添加30分钟。是否有可能在控制台应用程序

Actually i am getting Created_Date_Time from users table and saving in the string crtdt. now i want to add 30 min to that Created_Date_Time. is it possible in console application

推荐答案

看看下面的例子:



Have a look at below example:

DateTime currentTime = DateTime.Now;
currentTime = currentTime.AddMinutes(30);
Label.Text = currentTime.ToString();





以上代码将在当前日期时间增加30分钟。



Above code will add 30 minutes to the current datetime.


这篇关于如何在控制台应用程序中将mints添加到datetime的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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