-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCode
More file actions
30 lines (24 loc) · 928 Bytes
/
Code
File metadata and controls
30 lines (24 loc) · 928 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using System;
namespace SecondConvertor
{
internal class Program
{
static void Main(string[] args)
{
var year = 31104000; var month = 2592000;var day = 86400;var hour = 3600;var minute = 60;
Console.Write("Enter Seconds : ");
int second = int.Parse(Console.ReadLine());
var iyear = second/year;
var RemainSec = second % year;
var imonth = RemainSec / month;
RemainSec = RemainSec % month;
var iday = RemainSec / day;
RemainSec = RemainSec % day;
var ihour = RemainSec / hour;
RemainSec = RemainSec % hour;
var iminute = RemainSec / minute;
RemainSec = RemainSec % minute;
Console.WriteLine($"{iyear} Years , {imonth} Months , {iday} Days , {ihour} Hours , {iminute} Minutes , {RemainSec} Seconds");
}
}
}