0
How many secondes till 2AM ?
I try to calculate how many seconds there are left till 2AM. Using a timespan object at 1AM the result should be 3600 seconds at 3AM the result should be 82800 seconds at 10PM the result should be 14400 second How can I do this ?
9 Answers
+ 2
from current time
+ 2
with c# language
+ 1
you mean hour to seconds
+ 1
I mean calculate how many seconds are left till 2AM the next day ?
+ 1
yes
+ 1
yes
+ 1
sorry C# is not my language but i hope you can get help from heređ
https://stackoverflow.com/questions/5733521/timespan-between-now-and-next-hour
0
That is almost what I was looking for except that 2AM is most of the time past midnight.
Which makes it hard to substract datetime objects.
0
Made some code based on your suggestion and another stackoverflow post
https://stackoverflow.com/questions/4691721/how-to-find-the-exact-date-of-the-next-200-am-in-net/4691779
https://code.sololearn.com/celVg1TYs1nR
I think I found a solution, thanks