Epoch.cs
1 using System;
2 
3 public static class Epoch
4 {
8  public static int Current()
9  {
10  DateTime epochStart = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
11  int currentEpochTime = (int)(DateTime.UtcNow - epochStart).TotalSeconds;
12 
13  return currentEpochTime;
14  }
15 
19  public static string GetTimerString(int timeLeft)
20  {
21 
22  int minutes = timeLeft / 60;
23  int seconds = timeLeft - (minutes * 60);
24 
25  string timer = (minutes<10?"0": "") + minutes + " : " + (seconds<10?"0": "") + seconds;
26 
27  return timer;
28  }
29 
30 }
Epoch.GetTimerString
static string GetTimerString(int timeLeft)
Definition: Epoch.cs:19
Epoch.Current
static int Current()
Definition: Epoch.cs:8
Epoch
Definition: Epoch.cs:3