8 Replies
what I want:
Fix time: "00:00:60" --> "00:01:00:"
problem: the method returns 3 ints as a tuple and the other method accepts 3 ints that are not in a tuple
You can use TimeSpan for this, extract your hours, minutes, seconds and then use the TimeSpan class to construct a time that you can format
using your code, minus the tuples:
whaaat
is this better?
I just had the problem passing tuple
thats what was in my mind
Complete version using better descriptive names:
It's absolutely better to use
TimeSpan
in your case. https://learn.microsoft.com/en-us/dotnet/api/system.timespan.-ctor?view=net-8.0#system-timespan-ctor(system-int32-system-int32-system-int32)TimeSpan Constructor (System)
Initializes a new instance of the TimeSpan structure.
💃Hazel | へいぜる
REPL Result: Success
Console Output
Compile: 414.243ms | Execution: 24.919ms | React with ❌ to remove this embed.
You should really justify the need for a tuple because more often than not either a type already exists or you can easily create a concrete model to represent it.
i see