Epoch Class Reference

Static Public Member Functions

static int Current ()
 
static string GetTimerString (int timeLeft)
 

Detailed Description

Definition at line 3 of file Epoch.cs.

Member Function Documentation

◆ Current()

static int Epoch.Current ( )
static

Method to get seconds representation of current date

Definition at line 8 of file Epoch.cs.

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  }

◆ GetTimerString()

static string Epoch.GetTimerString ( int  timeLeft)
static

Method to get string representation of time left for current game sequence.

Definition at line 19 of file Epoch.cs.

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  }