Why will var day : Material; not work?

Hi, this is my code.
using UnityEngine;
using System.Collections;

public class NightDay : MonoBehaviour {
	
	double count = 0;
	bool didNightLast = false;

	void Update () {
		var day = Material;
		var night = Material;
		count += 0.0000000001;
		if (count == 2000000) {
			if (didNightLast) {
				RenderSettings.skybox = day;
				didNightLast = false;
			} else {
				RenderSettings.skybox = night;
			}
			count = 0;
		}
	}
}

I don’t get why it throws errors for the two night/day vars. Thanks in advance!

You haven’t written var day : Material; You’ve written var day = Material;but what I suspect you meant was public Material day; outside the Update function since the rest of your code appears to be C# rather than Unityscript.