An example of how to deal with dates (more info here):
var day1 = new System.DateTime(2010, 3, 12); // Year, Month, Day
var day2 = System.DateTime.Today;
var timeframe = System.TimeSpan(8,0,0,0); //Days, Hours, Minutes, Seconds
print(day1); //output: 03/12/2010 00:00:00
print(day2); //output: 03/17/2010 00:00:00
print(day2 - day1 + " < " + timeframe + " ?"); //output: 5.00:00:00 < 8.00:00:00 ?
if(day2 - day1 < timeframe) {
print("Within time period");
} else {
print("Time period exceeded");
}