如何从00:00:00消除日期 [英] how to eliminate 00:00:00 from date

查看:137
本文介绍了如何从00:00:00消除日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的数据库日期列中仅显示日期,如26-02-2015,但当我将我的数据库绑定到gridview时,它显示26-02-2015 00:00:00。我不想要00:00:00。

如何编写sql查询并绑定到gridview。这样只显示日期。

解决方案

请不要发布同样的问题。



这里你的老帖子:如何消除时间


 选择 转换 nvarchar  10 ),getdate(), 103 





或在你的GridView BoundField设置



 DataFormatString =   {0:DD / MM / YYYY} 


in my database date column shows only date like 26-02-2015 but when i bind my database to gridview it show 26-02-2015 00:00:00.I don't want that 00:00:00.
how to write sql query for that and bind to gridview.,so that only date will display.

解决方案

Please do not post the same question again.

Here your old post : how to eliminate time from date


select convert(nvarchar(10),getdate(),103)



or In your GridView BoundField set

DataFormatString="{0:dd/MM/yyyy}"


这篇关于如何从00:00:00消除日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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