On an ASP.NET page, I have the following:
<asp:Label ID="MyDateTimeLabel" runat="server"
Text='<%# Eval("MyDateTime") %>' />
I would like to format it as
... Eval("MyDateTime", "{0:d}") ...
if and only if the temporary part of MyDateTime is 00:00:00. Otherwise:
... Eval("MyDateTime", "{0:g}") ... // Display date and time in hh:mm format
Is it possible and how can I do it?
Thanks for the tips in advance!
source
share