zoukankan      html  css  js  c++  java
  • 几条常用 关于时间的 处理

    查询当天的内容:select * from article where  datediff(day,时间字段,getdate())=0

     本周:select * from article where  datediff(week,时间字段,getdate())=0

    DateTime dd = (DateTime)ds.Tables[0].Rows[i]["pubdate"];

    if (DateTime.Now.Date < dd.Date.AddDays(30))
    {
                    System.TimeSpan timeSpan = (System.TimeSpan)(DateTime.Now - dd.Date);
                    ds.Tables[0].Rows[i]["day"] = timeSpan.Days.ToString() + "天前";
    }

  • 相关阅读:
    CSU 1122
    CSU 1256
    CSU 1240
    HDU 1874
    CSU 1004
    Problem F CodeForces 16E
    Problem E CodeForces 237C
    Problem C FZU 1901
    12-30
    2016-12-29
  • 原文地址:https://www.cnblogs.com/terrorpig/p/1371778.html
Copyright © 2011-2022 走看看