All articles(网络文学目录) All Pictures(图片目录) All Softwares(软件目录)

 
c#时间增加并对比做法_[Asp.Net教程]

Writer: delv Article type: Programming skills(编程技巧) Time: 2014/1/6 9:06:48 Browse times: 319 Comment times: 0

c#时间增加并对比做法_[Asp.Net教程]


Head photo

Go homepage
Upload pictures
Write articles

c#时间增加并对比做法_[Asp.Net教程]

int jg=72;//设置一个增加的时间
DateTime dt=Convert.ToDateTime("2006-4-23 12:22:05");// 设置一个初始化的时间
DateTime newdt=dt.AddHours(jg);//初始化时间加上增加的时间
DateTime nowt=DateTime.Now;//现在的时间
Response.Write("现在时间是:"+nowt+"");
Response.Write("数据库时间是:"+dt+"");
Response.Write("新的时间是:"+newdt+"");
if(newdt {
Response.Write("可以");
}
else//否则
{
Response.Write("不行");
}


解决下面这个投票系统间隔时间的方法:

http://thcjp.cnblogs.com/archive/2006/04/20/380169.html

今天在看asp.net完全手册这书的时候发现的这个方法,忙着学习,懒得修改,如果有朋友觉得有必要就自己去改好了,修改方法就是把vote.aspx.cs 的load事件下面的时间判断修改下,然后在数据库中把vlog表中的dtime字段属性设置为 datetime 属性就可以了,呵呵!!





There are 0 records,
Comment:
Must be registered users to comment(必须是注册用户才能发表评论)

Disclaimer Privacy Policy About us Site Map
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.