Is there a function in .net that will take a number such as 134,501 and convert it to time? That time would be 1:45:01 pm. I was hoping i didn't have to reinvent the wheel for this.
Answer: There are 9,00,000 (nine lakh) 6-digit numbers in all. In the 6-digit numbers, the highest place value is 1,00,000 which has a unique name in the Indian numeral system – a lakh. Explanation: To find the total number of 6-digit numbers, let's first find the smallest and the largest 6-digit number.
I want to generate a random number with 6 digits. Some of you might tell me to use this code: Random generator = new Random(); int r = generator. Next(100000, 1000000);
Assuming you're using today's date:
int timeNumber = 134501;
DateTime time = DateTime.ParseExact(timeNumber.ToString().PadLeft(6, '0'), "HHmmss", null);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With