✅ How do i get a one digit hour and not to digit for example i want the hours are 2 and not 02
28 Replies
in the output i get the hours 02 and not 2
if i type 10000 seconds
oddly my WithSecure does not like that URL
well then i have to type the code here
$paste
If your code is too long, you can post to https://paste.mod.gg/ and copy the link into chat for others to see your shared code!
BlazeBin - ofspwjjmgxwr
A tool for sharing your source code with the world!
here is it
does it work
yup
okay
you can get the values like
ts.Hours
/ ts.Minutes
/ ts.Seconds
as in Console.WriteLine($"{ts.Seconds}");
but can i also do this? Console.WriteLine($"Seconds: {ts.Seconds}");
Not like this, no
Yes
Like this
yeah hahah
but
you can without the interpolation but it just looks bad
Console.WriteLine("Hours: {0} ", ts.Hours);
ts.Hours / ts.Minutes / ts.Seconds; this line gives an error
sure it does, as it's not code
I'm just mentioning the properties
It was just listing the values, not actual code lol
oh
Angius
REPL Result: Success
Result: string
Compile: 364.148ms | Execution: 30.108ms | React with ❌ to remove this embed.
the seconds must be an input
the user needs to write
Then make it an input ¯\_(ツ)_/¯
just replace it
okay
I'm just showing the interpolation
you already have tha portion of the code correct (not error free but still)
take input, create the
TimeSpan
, use the properties like ZZZZZZZZZZZZZZZZZZZZZZZZZ showedalright
thanks
bye
!close
take care
Closed!