I\'m having a similar problem with FormatException being thrown. My code is simply:
void Orders_OnSubmit() { DateTime CurrentTime = DateTime.Now; rtbAd
TimeOfDay is of type TimeSpan and it has different formatting options than DateTime. You also need to escape the colon (:)
TimeOfDay
TimeSpan
DateTime
:
currentTime.TimeOfDay.ToString("hh\\:mm\\:ss\\.ffffff")
Your sample tried to use the "HH" format which is defined for DateTime, but not for TimeSpan.
"HH"