It is nowadays known that the pineal gland is an endocrine organ, which produces the hormone melatonin in amounts which vary with the time of day. But this is a relatively recent discovery. Long before it was made, physicians and philosophers were already busily speculating about its functions.