Quantcast
Channel: Using timers and DateTime.Now
Viewing all articles
Browse latest Browse all 12

Using timers and DateTime.Now

$
0
0
Ok I found a way to solve the DateTime problem:

textBlock1.Text = Convert.ToString(DateTime.Now.Hour) + ":" + Convert.ToString(DateTime.Now.Minute) + ":" + Convert.ToString(DateTime.Now.Second);

is there anyway to convert it into a number like so... 00:00:00, because the code above would say 7, instead of 07, or 0 instead of 00 for example. All I can think of is using if statements to change each number, but is there a straight up easy way to just display current time in a normal format you would expect?

Viewing all articles
Browse latest Browse all 12

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>