要仅显示日期时间类型中的日期 [英] To display only date from datetime type

查看:64
本文介绍了要仅显示日期时间类型中的日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi frnds,
在我的应用程序中,我使用的是从racle数据库中获取值的gridview,有一个linkbutton,当用户单击它时..弹出消息msg弹出...现在...在gridview中有一个名为start的列日期类型为datetime ..在弹出的消息中,用户可以编辑此开始日期..im使用查询字符串从网格视图中获取开始日期值...现在..我只是想显示日期而不是时间弹出的消息.

hi frnds,
In my application,i m using a gridview which fetches value from racle database,there is a linkbutton where when the user clicks on it..a pop up msg pops up...now...in the gridview there is a coumn called start date of type datetime..in the pop up msg the user can edit this start date..i m getting the start date value from the grid view using query strings...now..i just wanna display the date and not the time in the pop up msg.

textbox.text=strings[3];


是我使用的语句,其中string [3]是包含... 11/2/2012 12:00 am.
的值. 现在,
我希望textbox.text的日期为2012年1月1日.
我该怎么办?
请帮助
感谢


is the statement i m using,where string[3] is the value containing...11/2/2012 12:00 am.
Now,
i want textbox.text to have oly 11/2/2012.
how do i do??
pls help
thanks

推荐答案

<asp id="Label1"  runat="server" Label.Text='<%# Eval("date", "{0:M-dd-yyyy}") %>'>


检查这些博客
http://www.daniweb.com/software-development/csharp/threads/127457 [ ^ ]
http://www.codeguru.com/forum/showthread.php?t=353407 [ ^ ]
--NDK
check these blogs
http://www.daniweb.com/software-development/csharp/threads/127457[^]
http://www.codeguru.com/forum/showthread.php?t=353407[^]
--NDK


尝试DateTime dateOnly = date.Date;


这篇关于要仅显示日期时间类型中的日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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