def jd2gd(jd,returnString=False):
	jd=jd+0.5
	Z=int(jd)
	F=jd-Z
	alpha=int((Z-1867216.25)/36524.25)
	A=Z + 1 + alpha - int(alpha/4)
	
	B = A + 1524
	C = int( (B-122.1)/365.25)
	D = int( 365.25*C )
	E = int( (B-D)/30.6001 )
	
	dd = B - D - int(30.6001*E) + F
	
	if E<13.5:
		mm=E-1
	
	if E>13.5:
		mm=E-13
	
	if mm>2.5:
		yyyy=C-4716
	
	if mm<2.5:
		yyyy=C-4715
	
	months=["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
	daylist=[31,28,31,30,31,30,31,31,30,31,30,31]
	daylist2=[31,29,31,30,31,30,31,31,30,31,30,31]
	
	h=int((dd-int(dd))*24)
	minutes=int((((dd-int(dd))*24)-h)*60)
	sec=86400*(dd-int(dd))-h*3600-minutes*60
	
	# Now calculate the fractional year. Do we have a leap year?
	if (yyyy%4 != 0):
		days=daylist2
	elif (yyyy%400 == 0):
		days=daylist2
	elif (yyyy%100 == 0):
		days=daylist
	else:
		days=daylist2
	
	hh = 24.0*(dd % 1.0)
	minutes = 60.0*(hh % 1.0)
	sec = 60.0*(minutes % 1.0)
	
	dd =  int(dd-(dd%1.0))
	hh =  int(hh-(hh%1.0))
	minutes =  int(minutes-(minutes%1.0))
	
	
	#print str(jd)+" = "+str(months[mm-1])+ ',' + str(dd) +',' +str(yyyy)
	#print str(h).zfill(2)+":"+str(minutes).zfill(2)+":"+str(sec).zfill(2)+" UTC"
	
	#print (yyyy, mm, dd, hh, minutes, sec)
	if returnString:
		return str(yyyy)+'-'+str(mm).zfill(2)+'-'+str(dd).zfill(2)+' '+str(hh).zfill(2)+':'+str(minutes).zfill(2)#+':'+str(sec)[0:2].zfill(2)
	else:
		return (yyyy, mm, dd, hh, minutes, sec)
Task to convert a list of julian dates to gregorian dates
dataset/ETHPy150Open OSCAAR/OSCAAR/oscaar/extras/eph/ephemeris.py/jd2gd