Question

I'm trying to show a 24 hours format using this line:

Text='<%# Bind("Appointment", "{HH:mm}")

So how it'll be formated for showing for example 16:40 instead 4:40?

Was it helpful?

Solution

if you don't need to bind it, try:

Text='<%# string.Format("{0:HH:mm}", Eval("Appointment"))%>'

otherwise i suppose you can update the field value in the OnDataBound event.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top