Time format in asp.net page

妖精的绣舞 提交于 2019-12-12 00:50:07

问题


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:

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!!!

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

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

could be IIS???


回答1:


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>

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.



来源:https://stackoverflow.com/questions/10549594/time-format-in-asp-net-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!