--[[
	shared.getdate() --Returns the current date
	shared.gettime() --Returns the current time
		shared.gettime(true) --Returns the current time in 24 hour format
	shared.getdatetime() --Returns the current time and date
		shared.getdatetime(true) --Returns the current time and date in 24 hour format
]]


months = {"January","February","March","April","May","June","July","August","September","October","November","December"}
daysinmonth = {31,28,31,30,31,30,31,31,30,31,30,31}
_G.gettime = function(hour24)
	time = tick()
	tsec = time % 86400
	hour = math.floor((tsec/60/60)%24)
	min = math.floor((tsec/60)%60)
	sec = math.floor(tsec%60)
	if sec < 10 then
		sec = "0"..sec
	end
	if min < 10 then
		min = "0"..min
	end
	if hour24 ~= true then
		if hour > 12 then
			hour = hour - 12
			sec = sec.." PM"
		else
			sec = sec.." AM"
		end
	end
	string = hour..":"..min..":"..sec
	return string
end
function shared.getdate()
	time = tick()
	year = math.floor(time/60/60/24/365.25+1970)
	day = math.ceil(time/60/60/24%365.25)
	for i=1, #daysinmonth do
		if day > daysinmonth[i] then
			day = day - daysinmonth[i]
		else
			month = months[i]
			break
		end
	end
	string = month.." "..day..", "..year
	return string
end
function shared.getdatetime(hour24)
	string = shared.gettime(hour24).." "..shared.getdate()
	return string
end
