问题
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