+ 2

Hi guys,can you help with the task.In language C#

The kth second of the year ic comming .It is necessary to determine how many full months and full weeks left until the end of the year.

1st Sep 2020, 5:41 AM
Вероника Яркаева
Вероника Яркаева - avatar
6 Answers
+ 2
// Define two dates. DateTime date1 = new DateTime(2020, 1, 1, 8, 0, 15); DateTime date2 = new DateTime(2021, 1, 1, 0, 0, 0); // Calculate the interval between the two dates. TimeSpan interval = date2 - date1; Console.WriteLine("{0} - {1} = {2}", date2, date1, interval.ToString()); // Display individual properties of the resulting TimeSpan object. Console.WriteLine(" {0,-35} {1,20}", "Value of Days Component:", interval.Days); Console.WriteLine(" {0,-35} {1,20}", "Total Number of Days:", interval.TotalDays); Console.WriteLine(" {0,-35} {1,20}", "Value of Hours Component:", interval.Hours); Console.WriteLine(" {0,-35} {1,20}", "Total Number of Hours:", interval.TotalHours); Console.WriteLine(" {0,-35} {1,20}", "Value of Minutes Component:", interval.Minutes); Console.WriteLine(" {0,-35} {1,20}", "Total Number of Minutes:", interval.TotalMinutes); Console.WriteLine(" {0,-35} {1,20:N0}", "Value of Seconds Component:", interval.Seconds); Console.WriteLine(" {0,-35} {1,20:N0}", "Total Number of
1st Sep 2020, 3:42 PM
hossein B
hossein B - avatar
+ 1
1. Convert seconds to days (k/(60*60*24)) 2. Convert days to weeks...
1st Sep 2020, 7:29 AM
Igor Kostrikin
Igor Kostrikin - avatar
+ 1
Good luck
1st Sep 2020, 3:44 PM
hossein B
hossein B - avatar
+ 1
thank you🤗
1st Sep 2020, 4:55 PM
Вероника Яркаева
Вероника Яркаева - avatar
0
Me neither 😓😓😅😅
1st Sep 2020, 6:54 AM
shashuri Magrease
shashuri Magrease - avatar
0
Ya Convert seconds to days Let you have x seconds Then It means x/60*60*24 = y days Then 365/366-y = z days are left in end of year And z/7 weaks are left.
1st Sep 2020, 9:31 AM
Divya Mohan
Divya Mohan - avatar