asp.net页面中的时间格式 [英] Time format in asp.net page

查看:87
本文介绍了asp.net页面中的时间格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用telerik RadDateTime控件将日期和时间插入到SQL Server DB的一个表中.问题是关于我在浏览器中看到的内容:

i use telerik RadDateTime control for insert date and time into one table of SQL Server DB. The problem is about what i see in browser:

当我的网格绑定到数据库时,它以dd/MM/yyyy hh.mm.ss格式显示包含日期时间值的单元格,而我想以dd/MM/yyyy hh:mm格式显示此数据: ss是因为当我进入编辑模式时,RadDateTimeColumn正确显示为:"而不是.".但是接下来,当我确认更新或插入时,该参数将再次以dd/MM/yyyy hh.mm.ss格式传递到存储过程!

when my grid is bind to the DB, it shows the cell containing the datetime value in format dd/MM/yyyy hh.mm.ss and i want to show this data in format dd/MM/yyyy hh:mm:ss because when i pass in edit mode, the RadDateTimeColumn shows correctly ":" instead of "." but next when i confirm the update or the insert, the parameter is passed to the storedprocedure in format dd/MM/yyyy hh.mm.ss again!!!

此问题仅存在于Web服务器上,因为我的计算机上存在相同的页面/数据库,并且都可以正常工作,我控制了CULTURE,WEB.CONFIG,但现在不知道该怎么做

this problem is only on the web server because the same pages/db are on my machine and all works correctly, i controlled CULTURE,WEB.CONFIG but I don't know what to do now

我还可以告诉我,如果我在Web服务器上调试网站,问题就会消失...

also i can tell that if i debug the website on the webserver the problem disappear...

可能是IIS ???

could be IIS???

推荐答案

如果您只想格式化页面上的日期,我想您可以执行以下操作.

If you are just wanting to format the date on the page I think you could do something like this.

<telerik:RadDateTimePicker ID="RadDateTimePicker1" runat="server">
    <DateInput
       DateFormat="dd/MM/yyy hh:mm:ss tt"
       DisplayDateFormat="dd/MM/yyy hh:mm:ss tt"  >
    </DateInput>
</telerik:RadDateTimePicker>

我知道这适用于datetimepicker控件,但是就RadDateTimeColumn而言,我不确定.可能存在类似于DateFormat和DisplayDateFormat的属性.

I know this works for a datetimepicker control, but as far as a RadDateTimeColumn, I am not sure. There are probably properties similar to the DateFormat and DisplayDateFormat.

这篇关于asp.net页面中的时间格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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