The Eval("DateTime")
Value that returns from your database is not a C# DataTime
object.
and because the function .ToLocalTime()
belongs to the DateTime
c# object you can't use it.
You need to convert the object to string and then use the function .ToLocalTime()
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="lblLocalTime" runat="server"
Text='<%# Convert.ToDateTime(Eval("DateTime")).ToLocalTime() %>'>
</asp:Label>
</ItemTemplate>
</asp:TemplateField>
Ones you converted it to DateTime
Object, you can use any format available
For Example
Text='<%# Convert.ToDateTime(Eval("DateTime")).ToString("dd/MM/yyyy") %>'