Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert 6 digit number to time in asp.net

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.

like image 346
Eric Avatar asked Jan 10 '11 16:01

Eric


People also ask

How much 6 digit is?

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.

How do you generate a 6 digit random number in R?

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);


1 Answers

Assuming you're using today's date:

int timeNumber = 134501;
DateTime time = DateTime.ParseExact(timeNumber.ToString().PadLeft(6, '0'), "HHmmss", null);
like image 193
Bret Walker Avatar answered Sep 22 '22 14:09

Bret Walker