I’m using a DateTime variable and I get minute and hour values to my string variables like:
timeValue.Hour.ToString() + ":" + timeValue.Minute.ToString()
But when the values contain 0‘s (zero), they behave like integers and get cropped.
For example: If the time is 19:30, then my string is like 19:3. or when it’s like 06:00, the string is 6:0.
How can I correct this except creating a zero-detector algorythm?
Because
HourandMinuteareintegers!will give you what you want
I have put the
:between''so that it’s always a:and it isn’t the locale-defined time separator (every nation can have a different time separator)