yesbe 发表于 2009-9-27 10:17:33

时间函数判断问题


<p ><strong>5qwe</strong> 发表于 2009-9-16 13:41</p>
<h3>时间函数判断问题</h3>我想当前天数大于1天或等于1天,判断一下,net怎样写
asp可以这样<% If datediff("d",rs("time"),now())>=1Then %>。。。<% Else %>。。。 <% End If %>
但net写样写才是正确,谢谢了<p ><strong>帅青蛙</strong> 发表于 2009-9-16 13:47</p>
System.DataTime.Now.AddDays(int days)
这个是DateTime类型的,然后跟今天时间做对比就行了。<p ><strong>5qwe</strong> 发表于 2009-9-16 19:54</p>
哎,不是很明,新手,详细点好么????<p ><strong>lmxc</strong> 发表于 2009-9-16 22:05</p>
DateTime nows = DateTime.Now;
    DateTime newn =Convert.ToDateTime("2009/09/01");
    TimeSpan days = nows - newn;
days.TotalSeconds.ToString()
  
页: [1]
查看完整版本: 时间函数判断问题