In spite of the popular myth that goldfish have only a 3-second memory, research conducted at Plymouth University has demonstrated that goldfish have a memory span of up to three months. These studies have also established that goldfish are able to associate time with feeding.
In one of the research tests, a lever was placed in an aquarium full of goldfish. Each time the fish nudged the handle, food would be dispensed. This was done until the fish associated the nudging action with food. Subsequent to this, the lever was modified so that it would issue food during one specific hour during the day. The fish quickly adapted to this and nudged the lever only at the time that it would dispense food. Some of the test goldfish even started to display signs of anticipation. The fish would gather near the lever as the feeding hour approached, but would not begin to nudge it until the hour arrived. This reaction has been compared to a person waiting outside of a store for it to open, knowing that it is useless to pull on the door until the "open" sign has been placed on the storefront.
Goldfish memory extends to color recognition. The eye of a goldfish is able to detect red, blue, green and ultraviolet light.