Translate

> > ASP.NET GridView TimeSpan 24 hour to AM PM

ASP.NET GridView TimeSpan 24 hour to AM PM

Posted on Thursday, December 2, 2021 | No Comments

 <asp:TemplateField HeaderText="IN_TIME">
                                            <ItemTemplate>
                                                <asp:Label ID="lblInTime" runat="server" Text='<%# new DateTime().Add(TimeSpan.Parse(Eval("IN_TIME").ToString())).ToString("hh:mm tt") %>' />
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="OUT_TIME">
                                            <ItemTemplate>
                                                <asp:Label ID="lblOUTTime" runat="server" Text='<%# new DateTime().Add(TimeSpan.Parse(Eval("OUT_TIME").ToString())).ToString("hh:mm tt") %>' />
                                            </ItemTemplate>
                                        </asp:TemplateField>

Leave a Reply

Powered by Blogger.