Hi All,
Panic has ensued while I have had 2 days off, Anyway I am doing
TimeOnly = String.Format("{0}:{1}", DateTime.Now.Hour, DateAndTime.Now.Minute.ToString)
This gives the time reported by Windows i.e. 14:25 but when the time is say 09:56 like it is now it returns 9:56 I need a method of re formatting the time so it has a leading 0 so 9:56
becomes 09:56 I have done similar in the past in C# with
DateTime.Now.ToString("hh") or DateTime.Now.ToString("HH")
TimeOnly = String.Format("{hh}:{mm}", DateTime.Now.Hour, DateAndTime.Now.Minute.ToString)
gives: "time is hh:mm" the same if DateTime.Now.Hour.ToString(hh) is not declared.
There has to be a more elegant solution than
if (DateAndTime.Now.Hour < 10) Then
doesn't there?