Datsun WAS/IS Nissan. It was never Toyota. The cars had the Datsun badge until 1984. Some of the earlier 300ZXs had both datsun and Nissan badges (mine did). Rumors had it that Nissan wasn't sure that their Z cars would make it in the US (new car niche, not muscle cars, not the typical giant two-door cars, and more comparable to the european sportsters), so to 'save face', they marketed the Z cars under the Datsun badge, then when the Z cars literally took off, they switched back to the Nissan name. But then again, there are lots of rumors.
Makes it confusing for some mechanics today, as I have to constantly remind them to look under 'Nissan' when ordering a part for my little Z.