<\/script>')

Different time format between browsers

I have a template label in my GridView:

<asp:Label ID="Label1" runat="server"
 Text='<%# String.Format("{0:t}", Eval("Time_From")) %>'>
</asp:Label>

But when my Gridview contacts, it shows 1:00 PM in Mozilla, but 13:00 in IE.

Why is this happening?

+5
source share
1 answer

Formatting seems to pick different cultures, but I donโ€™t believe that by default ASP.Net modifies the โ€œcurrent cultureโ€ based on the culture in the incoming request ... Maybe some of your other codes change the current culture based on something?

Try showing Thread.CurrentThread.CultureInfo to see if the culture is different on the server side.

+1
source

All Articles