以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- [求助]系统时间的显示模式可以更改么 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=47200) |
|
-- 作者:zhuzhi -- 发布时间:2014/3/6 11:33:00 -- [求助]系统时间的显示模式可以更改么 e.DataRow("时间") = Date.Today() 使用这段代码,得到电脑的系统时间,但此时间显示为:2014-3-6 0:00:00 时间的显示方式能改吗? 我想显示具体此刻的时间,显示样式能否改为20140306的样子呢?
|
|
-- 作者:Bin -- 发布时间:2014/3/6 11:36:00 --
|
|
-- 作者:狐狸爸爸 -- 发布时间:2014/3/6 11:51:00 -- 这样的话,你得把事件改为字符型列才行。
你可以正常赋值: e.DataRow("时间") = Date.Today()
然后在DrawCell事件中设置代码:
if e.Col.Name = "时间" Then if e.Row.Isnull("时间") = False Then e.Text = Foramt(e.Row("时间"),"yyyyMMdd") end if end if |