From this link using h is the correct format for an hour without a leading 0. Very interesting .. the following seem to work:
return string.Format("{0: h}", MyDateTimefield) return string.Format("{0:h }", MyDateTimefield) return string.Format("{0:h:m}", MyDateTimefield)
But as soon as you type return string.Format("{0:h}", MyDateTimefield) , it throws an exception.
As for me, I'm not sure. If you are ok with a space, the first 2 lines should work.
source share