Page 1 of 1

How to display time field in hh:mm:ss format

Posted: Sat Nov 18, 2023 11:47 pm
by gmandelli

The table on the mysql database has a time field.

I would like to present the format ih hour, minute and seconds (hh:mm:ss).

How is this possible?

Regards,
John


Re: How to display time field in hh:mm:ss format

Posted: Sun Nov 19, 2023 10:38 pm
by MichaelG

You can use the Row_Rendered server event to format the field. For example:

Field.ViewValue = Convert.ToDateTime(Field.CurrentValue).ToString("HH:mm:ss");

Re: How to display time field in hh:mm:ss format

Posted: Thu Nov 23, 2023 2:49 pm
by gmandelli

Ok.

But on insert field the control for time accept only hh:mm and not hh:mm:ss.

How to let user to insert HH.mm:ss in this Time datatype field?

Regards,,
John