function TryUpdate(K)local r,N,m,F,R local s,d if K>=0 and K<1440 then s=math.floor(K/60)d=K%60 if USE_MILITARY_TIME then r=displayMap[math.floor(s/10)+1]N=displayMap[(s-math.floor(s/10)*10)+1]if s==0 and d==0 then r=displayMap[3]N=displayMap[5]end else r=displayMap[math.floor((s%12)/10)+1]N=displayMap[(s%12-math.floor((s%12)/10)*10)+1]if s%12==0 then r=displayMap[2]N=displayMap[3]end end m=displayMap[math.floor(d/10)+1]F=displayMap[(d-math.floor(d/10)*10)+1]R=K>=720 and noon_P or noon_A Display(r,N,m,F,R)else Error()end end
-- Tries to update the display according to the time (in minutes after midnight), else displays err
function TryUpdate(mins)
	local d_hrsTens, d_hrsOnes, d_minsTens, d_minsOnes, d_noon
	local c_hrs, c_mins
	if mins >= 0 and mins < 1440 then
		c_hrs = math.floor(mins / 60)
		c_mins = mins % 60

		if USE_MILITARY_TIME then
			d_hrsTens = displayMap[math.floor(c_hrs / 10) + 1]
			d_hrsOnes = displayMap[(c_hrs - (math.floor(c_hrs / 10) * 10)) + 1]

			-- Special case for 2400
			if c_hrs == 0 and c_mins == 0 then
				d_hrsTens = displayMap[3]
				d_hrsOnes = displayMap[5]
			end
		else
			d_hrsTens = displayMap[math.floor((c_hrs % 12) / 10) + 1]
			d_hrsOnes = displayMap[((c_hrs % 12) - (math.floor((c_hrs % 12) / 10) * 10)) + 1]

			-- Special case for 12:00 A/P M
			if c_hrs % 12 == 0 then
				d_hrsTens = displayMap[2]
				d_hrsOnes = displayMap[3]
			end
		end
		d_minsTens = displayMap[math.floor(c_mins / 10) + 1]
		d_minsOnes = displayMap[(c_mins - (math.floor(c_mins / 10) * 10)) + 1]
		d_noon = (mins >= 720) and noon_P or noon_A

		Display(d_hrsTens, d_hrsOnes, d_minsTens, d_minsOnes, d_noon)
	else
		Error()
	end
end
