Inline in aspx, stripping date off of datetime

Posted by DJGray on Stack Overflow See other posts from Stack Overflow or by DJGray
Published on 2012-10-22T22:59:13Z Indexed on 2012/10/22 23:00 UTC
Read the original article Hit count: 117

Filed under:

I think if I just show you the following what I'm asking will make sense.

In a link in my aspx, this works: ' title='<%# Container.DataItem["EventTime"].ToString()

But the above contains the date portion of the string.

This does not work (nor does any variant of it): ' title='<%# Container.DataItem["EventTime"].ToString("hh:mm:ss tt", CultureInfo.InvariantCulture) %>

Evantually, we want the title/hover for the link to read something like "4:30 PM : @Forbes Field"

Everything is working with the exception of the 1/1/1900 being in front of the 4:30

How do I get the date off that EventTime datetime field?

© Stack Overflow or respective owner

Related posts about ASP.NET