How to represent the hour, minute and second in Timespan as 99

영훈 정 281 Reputation points
2022-10-19T07:33:47.17+00:00

Declaring new TimeSpan(99, 99, 99) like this gives us 4 days, 4 hours, 40 minutes and 39 seconds. I don't want to mark the date.

I want it to be expressed in hours, minutes, seconds, 99, 99, 99 as the values I put in.
Is this possible?

if possible please tell me how

Developer technologies | .NET | Xamarin
0 comments No comments
{count} votes

Accepted answer
  1. Anonymous
    2022-10-20T08:17:12.613+00:00

    Hello,

    I want it to be expressed in hours, minutes, seconds, 99, 99, 99 as the values I put in. Is this possible?

    No, Timespan will convert second, minute and hour. If you want to keep the input value, you can create several properties to keep it.

       h	The number of hours, which ranges from "0" to "23", with no leading zeros.  
       mm	The number of minutes, which ranges from "00" to "59"..  
       ss	The number of seconds, which ranges from "00" to "59"..  
    

    Best Regards,

    Leon Lu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.