Super Basic Question... GetComponent(Light)

So I am just trying to disable a light when my timeOfDay variable is greater than 14. This variable is in another script, GameTime. Seems so simple, yet it doesnt work, my light isnt disabled when it gets over 14 - I must be missing something really basic here lol.

code:

function Update()
{
	var n : GameTime = GetComponent(GameTime);
	if(n.timeOfDay > 14.0)
	{
		GetComponent(Light).enabled = false;
	}
	else
	{
		GetComponent(Light).enabled = true;
	}
}

P.S. there are no errors it just doesnt work. Also timeOfDay is a public variable. Thx.

Got it working - here is what I used: basically set the gameobject to a public var in the inspector and then accessed it:
var n : GameObject;

function Start()
{
	
}

function Update()
{

	if(n.GetComponent(GameTime).timeOfDay > 14.0)
	{
		Debug.Log ("Working");
		light.enabled = false;
	}
	else
	{
		light.enabled = true;
	}
}

var n : GameTime;
function Update()
{
//var n : GameTime = GetComponent(GameTime);
if(n.timeOfDay > 14.0)
{
GetComponent(Light).enabled = false;
}
else
{
GetComponent(Light).enabled = true;
}
}

Edit: removed misleading information