[代码]--c#获取系统时间

1         public DateTime GetServerDataTime()
2         {
3             string sql = " select top 1 getdate() from sysobjects ";
4             object dateTime = data.ExecuteScalar(sql);
5             return dateTime == null ? new CommonDAL(data).GetServerDataTime() : Convert.ToDateTime(dateTime);
6         }
View Code

 

posted @ 2016-11-02 15:27  春江花月夜、  阅读(1239)  评论(0编辑  收藏  举报