Apparently it had a tech demo video in November 1995, but I wouldn't count that for the same reason I don't count that "Zelda Experience" Wii U thing at E3 2011.
As far as I can find, the actual game was first shown at E3 1997 (June 19-21), but still had the subtitle "Zelda 64" as seen here:
This would put the timeframe as...
Ocarina of Time: 1 year 5 months