public int GetTimeComponent(DRTimeComponent component)
{
//First we divide time by the multiplier
long dividedTime = Math.Abs( time / MULTIPLIERS[(int) component]);
int returnValue = 0;
//Then, except for years, remainder divide with the multiplier after it
if ((int)component >= MULTIPLIERS.Length -1)
{
return (int)dividedTime;
}
else
{
returnValue = (int) (dividedTime % (MULTIPLIERS[(int)component + 1] / MULTIPLIERS[(int)component]));
}
if (component == DRTimeComponent.DAY || component == DRTimeComponent.MONTH)
{
//Increment by 1
return returnValue + 1;
}
return returnValue;
}