Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 binds, it shows 1:00 PM in Mozilla but 13:00 in IE.

Why is this happening?

like image 341
Gaurav Avatar asked Nov 12 '22 10:11

Gaurav


1 Answers

It looks like formatting picks different cultures, but I don't believe default ASP.Net site modifies "current culture" based on culture in incoming request... Maybe some of your other code changes current culture based on something?

Try to show Thread.CurrentThread.CultureInfo to see if server side culture is different.

like image 132
Alexei Levenkov Avatar answered Nov 14 '22 23:11

Alexei Levenkov