	
def GetDateDiffInDaysFromToday():
	if param.date == None or param.date == '' or  param.date == 'N-O-T-S-E-T':
		days = -1
	else:
		todaysDate = time.strftime('%m/%d/%Y', time.strptime(str(datetime.date.today()), '%Y-%m-%d'))
		days = GetDateDiffInDays(param.date, todaysDate)
	return days

def GetDateDiffInDays(date1, date2):
	if date1 == None or date1 == '' or  date1 == 'N-O-T-S-E-T' or date2 == None or date2 == '' or  date2 == 'N-O-T-S-E-T':
		days = -1
	else:
		parts1 = [int(piece) for piece in date1.split('/')]
		theDate1 = datetime.date(parts1[2], parts1[0], parts1[1])
		
		parts2 = [int(piece) for piece in date2.split('/')]
		theDate2 = datetime.date(parts2[2], parts2[0], parts2[1])
		
		datediff = theDate1 - theDate2
		days = datediff.days
	return days
	
def GetTimeFromGmtEpoch():
	if param.epoch == None or param.epoch == '' or  param.epoch == 'N-O-T-S-E-T':
		dt = ""
	else:
		epoch = datetime.datetime(1970,1,1,0,0)
		proctm = epoch + datetime.timedelta(seconds=int(param.epoch))
		dt = proctm.strftime(param.outFormat)
	return dt