F
Frank Rizzo
Hello,
I am trying to print out an hour in a format of 3pm or 5am. I've tried
the following, but it throws an exception saying invalid input string:
string times = string.Format("{0:h}{1:tt}", startTime, startTime);
However, if I change h to hh, it works fine, but then it prints out 03am
string times = string.Format("{0:hh}{1:tt}", startTime, startTime);
Does string.Format not support single digit hour?
I am trying to print out an hour in a format of 3pm or 5am. I've tried
the following, but it throws an exception saying invalid input string:
string times = string.Format("{0:h}{1:tt}", startTime, startTime);
However, if I change h to hh, it works fine, but then it prints out 03am
string times = string.Format("{0:hh}{1:tt}", startTime, startTime);
Does string.Format not support single digit hour?